Is is possible to limit timeout for connect?

July 09th, 2004 - 03:36 am ET by Antonio | Report spam
Hello everybody,

We are using WinSock2 library to establish a TCP/IP connection from client
to server. When host we are trying to connect to is not available (e.g.
switched off) it takes considerable time before connect() returns. Is it
possible to limit somehow timeout for connect() on the level of socket so,
that detection of unavailability of host takes less time?

Thanks in advance
Antonio
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 Arkady Frenkel
July 09th, 2004 - 02:43 pm ET | Report spam
For blocked socket's you too can do it ,because that settings in registry
but that affect all the system so usually not recommended .
Look at
http://groups.google.com/groups?hl=...f%241%40ne
ws.012.net.il&rnum=1&prev=/groups%3Fq%3Darkadyf%25203%252B6%252B12%26hl%3Den
%26lr%3D%26ie%3DUTF-8%26sa%3DN%26tab%3Dwg
( aware of wrap )
Arkady

"Gisle Vanem" wrote in message
news:40eea7d7$
"Antonio" wrote:

> We are using WinSock2 library to establish a TCP/IP connection from


client
> to server. When host we are trying to connect to is not available (e.g.
> switched off) it takes considerable time before connect() returns. Is it
> possible to limit somehow timeout for connect() on the level of socket


so,
> that detection of unavailability of host takes less time?

Yes, use a non-blocking socket and choose your own
connect-time with select() etc.



Similar topics