apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: [PATCH] WIN32 implementation of apr_poll_revents_get()
Date Wed, 05 Jun 2002 16:02:39 GMT
> > Also, I considered first using a flag in the apr_socket_t structure, but
> my
> > problem is that there is already one: 'disconnected'. I would use this
> > flag, but after many review of the code, I still don't know the utility of
> > this flag.

Has to do with a performance tweak on Windows. AcceptEx() accepts as arguments two
sockets, the listener and an unconnected accept socket. Creating a new accept socket (with
a call to socket()) is very expensive on Windows (the call has to percolate through many
layers of service providers each deciding if they should handle the call). Some of the
Win32 socket calls enable you to recycle the accept socket (TransmitFile for instance.).
If you tell TransmitFile to disconnect the accept socket, it can be reused on the AcceptEx
call and this is good for a double digit performance boost serving non-keepalive requests.
Check out mpm_winnt.c and apr_sendfile() on Windows to see how this flag is used.


View raw message