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
How to use :nTimeOut (TSocket)?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Dutch,
nTimeOut is not needed for connection. Just check the returned value from method ConnectTo():
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