Re: connect() timeout value

From: Rainer Temme (Rainer.Temme_at_NoSpam.Siemens.Com)
Date: 06/30/05


Date: Thu, 30 Jun 2005 12:42:40 +0200

Hi Gareth,

in principle, you have two options to do what you want...

one is (as you mentioned) the use of the alarm-signal...
    the manpages for alarm() and signal() should help you with
    that.

the other option is to make the socket-fd nonblocking,
    and to use of select() / poll() after connect()
    Note, that in this case connect() will not be blocking ...
    but will return -1 and errno set to EINPROGRSS.
    select()/poll() have timeout values, so that's
    where you can implement the desired waiting time.

Regards ... Rainer