> At 11:02 AM 6/5/2002, FirstBill wrote: > > > > 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. > > Yes But. > > But why does that affect APR? We must support socket applications > other than Apache with apr, with no need to grok the internals of what > should be private structures. > > If we have broken APR to support mpm_winnt's AcceptEx model, then > APR is broken. If you need to add extra flags to share the apr code with > the mpm, feel free, but we need a compliant APR sockets architecture. > > We currently fail most of the network_io test suite. I am happy to commit > any patches that I can verify will improve our Win32 compliance with apr's > test suite. Patch authors, *please* indicate that your patch has already > passed the test suite when posting. If it requires several patches, please > post them separately and indicate which other patches are required. > > And if our tests themselves are broken, patches there too are welcome :-) > > Bill >
Don't worry, the disconnect flag does not break anything (semantically or otherwise) in APR. The notion of a disconnected socket doesn't apply to just Win32 though to my knowledge, no *ix platforms implement it. Bill
