nginx-quic/src/event/modules/ngx_overlapped_module.c

42 lines
992 B
C
Raw Normal View History

2002-08-15 13:20:26 -04:00
event = WSACreateEvent(void);
WSAEventSelect(s, event, FD_ACCEPT);
int ngx_overlapped_process_events(ngx_log_t *log)
{
if (acceptex)
2002-08-15 13:20:26 -04:00
n = SleepEx(timer, 1);
else
2002-08-15 13:20:26 -04:00
n = WSAWaitForMultipleEvents(nevents, events, 0, timer, 1);
if (n == WSA_WAIT_TIMEOUT)
close some event;
if (n == WSA_IO_COMPLETION)
again
/* try it with AcceptEx() on NT to detect connected sockets */
if (!acceptex) {
WSAEnumNetworkEvents(
sockets[n - WSA_WAIT_EVENT_0],
events[n - WSA_WAIT_EVENT_0],
net_events);
if (net_events.lNetworkEvents & FD_ACCEPT) {
if (net_events.iErrorCode[FD_ACCEPT_BIT] != 0)
accept error
again
2002-08-15 13:20:26 -04:00
ngx_event_accept(); OR post AcceptEx();
}
}
}
void CALLBACK overlapped_completion_procedure(DWORD error, DWORD nbytes,
LPWSAOVERLAPPED overlapped, DWORD flags)
{
2002-08-15 13:20:26 -04:00
run event handler
}