apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Craig Lewallen <jlewa...@cs.ucr.edu>
Subject [PATCH] Socket timeouts and APR_SO_NONBLOCK?
Date Wed, 28 May 2003 20:17:50 GMT
	I mentioned this a few months ago and she seems to have fallen through 
the cracks... or I'm mistaken and nobody told me... I'm using the 
apr_socket_timeout_set call to set a timeout on a socket and then using 
the same call to turn the timeout off again after I've established a 
connection. There seems to be a small problem with the flag management 
in this process.

	Basically, APR, as expected, makes the socket non blocking to handle 
the timeouts. When I turn off the timeouts, it fails to clear the flag 
from the socket's file descriptor because the code never sets the 
APR_SO_NONBLOCK flag in the APR socket's netmask. For example, the 
socket is properly returned to blocking if I set the socket to non 
blocking myself and then turn on the timeout and then turn it back off. 
This works because APR_SO_NONBLOCK is being set explicitly by me. I've 
included a patch that will set APR_SO_NONBLOCK when APR makes a socket 
non blocking behind the scenes to handle timeouts, it's very simple, 
trust me.

	Does this make sense?

--
jacob lewallen
jlewalle@cs.ucr.edu

Mime
View raw message