apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saxon Druce" <sa...@blocksoftware.com>
Date Mon, 12 May 2003 14:22:39 GMT

About a year ago I wrote a networking app using apr. I'm now updating to the
latest version, which means moving to the new poll API.

In the old API, in Win32 or if HAVE_POLL wasn't defined in Unix,
apr_poll_revents_get() would do a 1-byte 'peek recv' to see if a socket
being in the read set after select() was actually APR_POLLHUP, APR_POLLNVAL
or APR_POLLERR, as opposed to the standard APR_POLLIN which being in the
read set is generally for.

With the new API this isn't done, meaning APR_POLLHUP would never be in the
value returned by apr_poll_revents_get(). Is getting an APR_POLLIN following
by an apr_recv() which doesn't return APR_SUCCESS now the correct way to
detect that the connection has been closed?

Is it a portability issue that in Unix if HAVE_POLL is defined (meaning
poll() gets used) APR_SIGHUP may be returned, when in other situations
(Win32 or !HAVE_POLL) it can't be?


View raw message