You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by David Barrett <db...@quinthar.com> on 2004/10/15 09:04:56 UTC

SOCEINPROGRESS returned on non-blocking, zero-timeout socket

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 
executing."

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 
different?

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?

Thanks!

-david