You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
To clarify the syntax of the TCP OPEN statement a little for you:
Code:
[b]As a client:[/b]
TCP OPEN {PORT [i]p&[/i] | [i]srvc$[/i]} AT [i]host$[/i] AS [#] [i]fnum&[/i] [TIMEOUT [i]timeoutval&[/i]]
[b]As a Server:[/b]
TCP OPEN SERVER [ADDR [i]ip&[/i]] {PORT [i]p&[/i] | [i]srvc$[/i]} AS [#] [i]fnum&[/i] [TIMEOUT [i]timeoutval&[/i]]
Also, timeoutval& is specified in seconds (contrary to what the help file says).
I seem to be having a bit of a problem. When I'm connected
to the internet, my computer has about 3 IP addresses. I'm trying
to write a server and only the second IP address can be used
(The one that was assigned to me by my ISP).
I use:
TCP OPEN SERVER PORT %PORT AS SocketHandle
The problem is that using the command above, opens the
server using the first IP address, I've done a couple of test,
and the first IP is only accessible from the local computer. I'm
guessing it's my IP for a home network or something (Although, I
don't have a home network).
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: