[Vortex] Can't shorten TCP connect timeout

Jens Alfke jens at mooseyard.com
Thu Mar 13 02:37:34 CET 2008


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?

—Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://lists.aspl.es/pipermail/vortex/attachments/20080312/31d0f81d/attachment.bin 


More information about the Vortex mailing list