[Libevent-users] Win32 I/O completion ports code release
Kevin Sanders
newroswell at gmail.com
Tue Dec 5 09:56:34 EST 2006
On 12/5/06, Toby Douglass <toby.douglass at summerblue.net> wrote:
> Gordon Scott wrote:
> >>> One technical note; I believe that I/O completion ports cannot handle
> >>> accept() type behaviour,
> >
> > What do you mean by this?
>
> With an IOCP, you can give the IOCP a *connected* socket and the IOCP
> will call you back when a read occurs.
>
> But you cannot pass in an *unconnected* socket in the listen state, for
> the IOCP is not capable of calling you back when an incoming connection
> occurs and you need to call accept().
>
> The docs say the following functions can be used with an IOCP;
>
> ConnectNamedPipe
> DeviceIoControl
> LockFileEx
> ReadDirectoryChangesW
> ReadFile
> TransactNamedPipe
> WaitCommEvent
> WriteFile
>
> So, as you can see, it doesn't seem possible to use an IOCP to handle
> incoming connections.
>
> FYI, libiocp 1.03 was put on the site last night. I'm going to add some
> example code next, and then maybe integrate the listen/accept solution
> I've written.
Use AcceptEx.
More information about the Libevent-users
mailing list