32 {0xe70f1aa0, 0xab8b, 0x11cf,
33 {0x8c, 0xa3, 0x00, 0x80, 0x5f, 0x48, 0xa1, 0x92}},
34 {0xf9eab0c0, 0x26d4, 0x11d0,
35 {0xbb, 0xbf, 0x00, 0xaa, 0x00, 0x6c, 0x34, 0xe4}},
36 {0x9fc48064, 0x7298, 0x43e4,
37 {0xb7, 0xbd, 0x18, 0x1f, 0x20, 0x89, 0x79, 0x2a}}
55 event = CreateEvent(NULL,
TRUE,
TRUE, NULL);
81 if (
handle->submitted_events_1 == 0) {
83 afd_poll_info = &
handle->afd_poll_info_1;
87 }
else if (
handle->submitted_events_2 == 0) {
89 afd_poll_info = &
handle->afd_poll_info_2;
123 memset(&
req->u.io.overlapped, 0,
sizeof req->u.io.overlapped);
128 &
req->u.io.overlapped);
129 if (
result != 0 && WSAGetLastError() != WSA_IO_PENDING) {
153 if (
result == SOCKET_ERROR) {
154 DWORD
error = WSAGetLastError();
155 if (
error != WSA_IO_PENDING)
165 unsigned char mask_events;
169 afd_poll_info = &
handle->afd_poll_info_1;
170 handle->submitted_events_1 = 0;
171 mask_events =
handle->mask_events_1;
173 afd_poll_info = &
handle->afd_poll_info_2;
174 handle->submitted_events_2 = 0;
175 mask_events =
handle->mask_events_2;
190 unsigned char events = 0;
204 events &=
handle->events & ~mask_events;
219 handle->submitted_events_2)) != 0) {
222 handle->submitted_events_1 == 0 &&
223 handle->submitted_events_2 == 0) {
230 assert(
handle->type == UV_POLL);
236 if (
handle->events != 0) {
243 handle->submitted_events_2)) != 0) {
255 if (
handle->submitted_events_1 == 0 &&
256 handle->submitted_events_2 == 0) {
268 WSAPROTOCOL_INFOW* protocol_info) {
271 sock = WSASocketW(protocol_info->iAddressFamily,
272 protocol_info->iSocketType,
273 protocol_info->iProtocol,
276 WSA_FLAG_OVERLAPPED);
277 if (sock == INVALID_SOCKET) {
278 return INVALID_SOCKET;
281 if (!SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0)) {
285 if (CreateIoCompletionPort((HANDLE) sock,
296 return INVALID_SOCKET;
301 WSAPROTOCOL_INFOW* protocol_info) {
307 if (memcmp((
void*) &protocol_info->ProviderId,
309 sizeof protocol_info->ProviderId) == 0) {
316 return INVALID_SOCKET;
321 peer_socket =
loop->poll_peer_sockets[
index];
322 if (peer_socket == 0) {
324 loop->poll_peer_sockets[
index] = peer_socket;
334 unsigned char reported_events;
339 assert(
handle->type == UV_POLL);
340 assert(
req->type == UV_POLL_REQ);
344 rfds.fd_array[0] =
handle->socket;
351 wfds.fd_array[0] =
handle->socket;
353 efds.fd_array[0] =
handle->socket;
364 r = select(1, (fd_set*) &rfds, (fd_set*) &wfds, (fd_set*) &efds, &
timeout);
365 if (
r == SOCKET_ERROR) {
375 if (rfds.fd_count > 0) {
376 assert(rfds.fd_count == 1);
377 assert(rfds.fd_array[0] ==
handle->socket);
381 if (wfds.fd_count > 0) {
382 assert(wfds.fd_count == 1);
383 assert(wfds.fd_array[0] ==
handle->socket);
385 }
else if (efds.fd_count > 0) {
386 assert(efds.fd_count == 1);
387 assert(efds.fd_array[0] ==
handle->socket);
393 req->u.io.overlapped.InternalHigh = (DWORD) reported_events;
404 if (
handle->submitted_events_1 == 0) {
407 handle->mask_events_1 = 0;
409 }
else if (
handle->submitted_events_2 == 0) {
413 handle->mask_events_2 = 0;
421 WT_EXECUTELONGFUNCTION)) {
432 unsigned char mask_events;
436 handle->submitted_events_1 = 0;
437 mask_events =
handle->mask_events_1;
439 handle->submitted_events_2 = 0;
440 mask_events =
handle->mask_events_2;
448 if (
handle->events != 0) {
455 int events =
req->u.io.overlapped.InternalHigh &
handle->events & ~mask_events;
462 handle->submitted_events_2)) != 0) {
465 handle->submitted_events_1 == 0 &&
466 handle->submitted_events_2 == 0) {
473 assert(
handle->type == UV_POLL);
479 if (
handle->events != 0) {
486 ~(
handle->submitted_events_1 |
handle->submitted_events_2)) != 0) {
498 if (
handle->submitted_events_1 == 0 &&
499 handle->submitted_events_2 == 0) {
514 WSAPROTOCOL_INFOW protocol_info;
516 SOCKET peer_socket, base_socket;
521 if (ioctlsocket(
socket, FIONBIO, &yes) == SOCKET_ERROR)
529 base_socket = INVALID_SOCKET;
541 assert(base_socket != 0 && base_socket != INVALID_SOCKET);
550 len =
sizeof protocol_info;
554 (
char*) &protocol_info,
564 if (peer_socket != INVALID_SOCKET) {
566 handle->peer_socket = peer_socket;
573 handle->submitted_events_1 = 0;
577 handle->submitted_events_2 = 0;
639 assert(
handle->submitted_events_1 == 0);
640 assert(
handle->submitted_events_2 == 0);