Hi Catcher,

All your code looks good enough to me at *first glance* so I suspect 
it's simply a network issue.  Try to ping that address to see what 
happens.

Marc

>I'm trying to connect to a server, send a request, and receive an 
>answer.
>I get an Error 103 ("unable to resolve the address") with this code:
>
>    dim sock as TCPSocket
>    dim out as String
>
>    sock = New TCPSocket
>    sock.address = "200.122.182.106"
>    sock.Port = 2010
>
>    sock.Connect
>
>-----------------
>If I replace the IP address with a fully qualified URL then there's 
>no problem. But in my case the IP address is all I have.
>
>On another note, I haven't yet reached the rest of the code. Does it 
>look reasonable? The conversation is simple. I send a request, it 
>sends a reply, and that's it.
>
>    While Not sock.IsConnected
>      If sock.LastErrorCode <> 0 then
>        msgbox "Socket Error: " + str(sock.LastErrorCode)
>        Exit
>      End If
>      sock.Poll
>    Wend
>
>    If sock.IsConnected then
>      While sock.BytesAvailable = 0
>        If sock.LastErrorCode <> 0 then
>          msgbox "Socket Error: " + str(sock.LastErrorCode)
>          Exit
>        End If
>        sock.Poll
>      Wend
>      out = sock.ReadAll()
>    Else
>      out = "Socket failed to connect"
>    End If
>    sock.Close
>    return out
>    ----------------
>
>Thanks.
>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>
>Search the archives:
><http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to