How can i control a connection timeout on a TCP socket?
I have an "isAlive" function that simply connects to an open port on a server via TCP. (i havent got the server code so i cannot change anything).
1) If the server is up and is accepting connections i can find out immediately.
2) If the server is down the timeout on my client connection takes an inordinate amount of time to complete.
My client code simply opens up a socket and calls connect. If it fails the server is deemed dead.
I have tried :-
select(fd, NULL, writefds, NULL, timeval)
with a timeval set to 3 secs but it makes no difference?
The BSD setsockopt() fn takes a READTIMEVAL param, but the one on windows does not.
Can anyone help me or point me in the correct direction
Thanks
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement