apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mansion" <ja...@wgold.demon.co.uk>
Subject RE: Seting FD_SETSIZE on WIN32
Date Sun, 17 Apr 2005 08:36:02 GMT
>Feel free to research; the issue is the underlying calls to
>[WSA]WaitForEventOrTimeout ... Windows can't poll more than
>64 handles + timeout event.

Well, yes, but that's only an issue if you use the Win32 APIs
the wrong way.

Don't put socket handles in the Wait array.

Hopefully it can be rescued without the surgery that a change
to an IOCP structure would mean:

* create an array of event objects, some convenient prime in
  size <64
* for each (async) IO request against a socket, use the overlapped
  IO facility, and hash a structure for the IO randomly across
  these event objects
* maintain a list of requests against each event where we
  contain the OVERLAPPED structures with their hEvent set to
  the associated event
* WaitForMultipleObjects return will tell you which request list
  to search
* check the completion status of each OVERLAPPED structure.

Alternatively use the completion routine facility and receive
notification by APCs.

Windows can manage socket IO across lots of sockets.  This
perceived limitation is only an issue because people familiar
with select(0 or poll() expect to use the WaitForMulti the same
way.  You can, but only with this limitation.  We shouldn't
blame Microsoft if people don't read and understand the API.

James




Mime
View raw message