Page 1 of 1

How to use :nTimeOut (TSocket)?

Posted: Wed Jun 11, 2008 4:29 am
by dutch
I would like to know :nTimeOut meaning and how to use it. Because I have not know the the server activate after I start the client. TSocket client cannot know when the server re-activate again after down.

The :nTimeOut might be the way out.

Regards,
Dutch

Posted: Thu Jun 12, 2008 7:24 am
by Antonio Linares
Dutch,

nTimeOut is not needed for connection. Just check the returned value from method ConnectTo():

Code: Select all

#define SOCKET_ERROR    (-1)
...
if oSocket:ConnectTo( cIPAddr, nPort ) == SOCKET_ERROR
   MsgAlert( "can't connect to server!" )
endif