apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Praher <jakob.pra...@dynatrace.com>
Subject Re: apr_socket_connect
Date Wed, 12 Apr 2006 12:57:08 GMT
hi jeff,



Jeff Trawick wrote:
> On 4/12/06, Jakob Praher <jakob.praher@dynatrace.com> wrote:
>>hi all,
>>
>>apparently I have a strange problem with apr_socket_connect, when
>>calling it several times within a short time period, it turns out to
>>return APR_SCUCESS without actually succeeded in connect( )ing!
> 
> What socket options have you set on the socket?  timeout or just non-blocking?

blocking with timeout, the following settings apply:

apr_socket_opt_set(mpSocket, APR_TCP_NODELAY, 1);
apr_socket_timeout_set(mpSocket, 30*1000000LL );

everything else is as is.

> 
> If you set it to non-blocking, did you wait for the APR_POLLOUT
> condition with apr_poll() on the socket before calling
> apr_socket_connect again?  I think the error from getsockopt() is
> reset once it is retrieved the first time.  That may be the issue
> triggered with calling apr_socket_connect() multiple times.
> 
see above. it is a vanilla blocking socket.

> I wouldn't suspect a bug in the kernel for this, or many applications
> would fail.
> 
it is interesting though.
it boils really down to that, it is due to getsockopt.

--
Jakob


Mime
View raw message