apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Barrett <dbarr...@quinthar.com>
Subject SOCEINPROGRESS returned on non-blocking, zero-timeout socket
Date Fri, 15 Oct 2004 07:04:56 GMT
I'm seeing unexpected behavior when I use "apr_opt_set( s, 
APR_SO_NONBLOCK, 1 )" in conjunction with "apr_socket_timeout( s, 0 )".  
Basically, the following code generates no error return values:

1# apr_socket_create( &s, APR_INET, SOCK_STREAM, APR_PROTO_TCP, pool );
2# apr_opt_set( s, APR_SO_NONBLOCK, 1 );
3# // apr_socket_timeout( s, 0 );
4# apr_socket_connect( s, addr );

However, if I uncomment line #3, then line #4 returns SOCEINPROGRESS.  
(Note, that is different than EAGAIN, which is tied to SOCEWOULDBLOCK.)  
The full error message is "A blocking operation is currently 

Why is this?  I *think* I'm supposed to both set non-blocking and zero 
timeout, but this is causing me errors.  Am I supposed to do something 

As a workaround I'll just leave line #3 commented, but I think this'll 
create portablility problems when I compile on Linux.  Any ideas what 
I'm doing wrong?



View raw message