Re: connect() timeout value
From: Rainer Temme (Rainer.Temme_at_NoSpam.Siemens.Com)
Date: 06/30/05
- Next message: Rainer Temme: "Re: Sockets and FTP protocol"
- Previous message: Gareth Crispin: "connect() timeout value"
- In reply to: Gareth Crispin: "connect() timeout value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Rainer Temme: "Re: Sockets and FTP protocol"
- Previous message: Gareth Crispin: "connect() timeout value"
- In reply to: Gareth Crispin: "connect() timeout value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]