[Vortex] Can't shorten TCP connect timeout

Francis Brosnan Blazquez francis at aspl.es
Thu Mar 13 13:16:34 CET 2008

Hi Jens,

> I want to shorten the timeout for opening a VortexConnection if the  
> other host can't be reached. But calling  
> vortex_connection_connect_timeout isn't affecting anything — it still  
> takes over a minute for the connection attempt to fail.
> Looking at the source, __vortex_connection_new doesn't do anything to  
> set a timeout for the TCP connect( ) call. It only uses the timeout  
> *after* the socket's been opened. So this looks like a bug (or missing  
> functionality.)
> I'm no expert at socket programming, and I'm seeing conflicting advice  
> on how to get connect( ) to time out, either
> (1) Call alarm( ) before connect( ), to send a SIGALARM that will  
> cause connect( ) to abort; or
> (2) Set the socket to nonblocking mode before connecting, then call  
> select( ) to wait for the connection.
> Neither of these looks very easy, and I'm not sure which to do. Any  
> suggestions?

This is a bug (there is a missing call to
vortex_connection_set_nonblock_socket) just before calling to the tcp

Try to checkout latest svn to get the fix.

Thanks for reporting Jens. Cheers!

> —Jens

Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.

More information about the Vortex mailing list