win/poll.c
Go to the documentation of this file.
1 /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #include <assert.h>
23 #include <io.h>
24 
25 #include "uv.h"
26 #include "internal.h"
27 #include "handle-inl.h"
28 #include "req-inl.h"
29 
30 
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}}
38 };
39 
40 typedef struct uv_single_fd_set_s {
41  unsigned int fd_count;
42  SOCKET fd_array[1];
44 
45 
46 static OVERLAPPED overlapped_dummy_;
48 
50 
51 
52 static void uv__init_overlapped_dummy(void) {
53  HANDLE event;
54 
55  event = CreateEvent(NULL, TRUE, TRUE, NULL);
56  if (event == NULL)
57  uv_fatal_error(GetLastError(), "CreateEvent");
58 
60  overlapped_dummy_.hEvent = (HANDLE) ((uintptr_t) event | 1);
61 }
62 
63 
64 static OVERLAPPED* uv__get_overlapped_dummy(void) {
66  return &overlapped_dummy_;
67 }
68 
69 
71  return &afd_poll_info_dummy_;
72 }
73 
74 
76  uv_req_t* req;
77  AFD_POLL_INFO* afd_poll_info;
78  int result;
79 
80  /* Find a yet unsubmitted req to submit. */
81  if (handle->submitted_events_1 == 0) {
82  req = &handle->poll_req_1;
83  afd_poll_info = &handle->afd_poll_info_1;
84  handle->submitted_events_1 = handle->events;
85  handle->mask_events_1 = 0;
86  handle->mask_events_2 = handle->events;
87  } else if (handle->submitted_events_2 == 0) {
88  req = &handle->poll_req_2;
89  afd_poll_info = &handle->afd_poll_info_2;
90  handle->submitted_events_2 = handle->events;
91  handle->mask_events_1 = handle->events;
92  handle->mask_events_2 = 0;
93  } else {
94  /* Just wait until there's an unsubmitted req. This will happen almost
95  * immediately as one of the 2 outstanding requests is about to return.
96  * When this happens, uv__fast_poll_process_poll_req will be called, and
97  * the pending events, if needed, will be processed in a subsequent
98  * request. */
99  return;
100  }
101 
102  /* Setting Exclusive to TRUE makes the other poll request return if there is
103  * any. */
104  afd_poll_info->Exclusive = TRUE;
105  afd_poll_info->NumberOfHandles = 1;
106  afd_poll_info->Timeout.QuadPart = INT64_MAX;
107  afd_poll_info->Handles[0].Handle = (HANDLE) handle->socket;
108  afd_poll_info->Handles[0].Status = 0;
109  afd_poll_info->Handles[0].Events = 0;
110 
111  if (handle->events & UV_READABLE) {
112  afd_poll_info->Handles[0].Events |= AFD_POLL_RECEIVE |
114  } else {
115  if (handle->events & UV_DISCONNECT) {
116  afd_poll_info->Handles[0].Events |= AFD_POLL_DISCONNECT;
117  }
118  }
119  if (handle->events & UV_WRITABLE) {
120  afd_poll_info->Handles[0].Events |= AFD_POLL_SEND | AFD_POLL_CONNECT_FAIL;
121  }
122 
123  memset(&req->u.io.overlapped, 0, sizeof req->u.io.overlapped);
124 
125  result = uv_msafd_poll((SOCKET) handle->peer_socket,
126  afd_poll_info,
127  afd_poll_info,
128  &req->u.io.overlapped);
129  if (result != 0 && WSAGetLastError() != WSA_IO_PENDING) {
130  /* Queue this req, reporting an error. */
131  SET_REQ_ERROR(req, WSAGetLastError());
133  }
134 }
135 
136 
138  AFD_POLL_INFO afd_poll_info;
139  int result;
140 
141  afd_poll_info.Exclusive = TRUE;
142  afd_poll_info.NumberOfHandles = 1;
143  afd_poll_info.Timeout.QuadPart = INT64_MAX;
144  afd_poll_info.Handles[0].Handle = (HANDLE) handle->socket;
145  afd_poll_info.Handles[0].Status = 0;
146  afd_poll_info.Handles[0].Events = AFD_POLL_ALL;
147 
148  result = uv_msafd_poll(handle->socket,
149  &afd_poll_info,
152 
153  if (result == SOCKET_ERROR) {
154  DWORD error = WSAGetLastError();
155  if (error != WSA_IO_PENDING)
156  return error;
157  }
158 
159  return 0;
160 }
161 
162 
164  uv_req_t* req) {
165  unsigned char mask_events;
166  AFD_POLL_INFO* afd_poll_info;
167 
168  if (req == &handle->poll_req_1) {
169  afd_poll_info = &handle->afd_poll_info_1;
170  handle->submitted_events_1 = 0;
171  mask_events = handle->mask_events_1;
172  } else if (req == &handle->poll_req_2) {
173  afd_poll_info = &handle->afd_poll_info_2;
174  handle->submitted_events_2 = 0;
175  mask_events = handle->mask_events_2;
176  } else {
177  assert(0);
178  return;
179  }
180 
181  /* Report an error unless the select was just interrupted. */
182  if (!REQ_SUCCESS(req)) {
183  DWORD error = GET_REQ_SOCK_ERROR(req);
184  if (error != WSAEINTR && handle->events != 0) {
185  handle->events = 0; /* Stop the watcher */
186  handle->poll_cb(handle, uv_translate_sys_error(error), 0);
187  }
188 
189  } else if (afd_poll_info->NumberOfHandles >= 1) {
190  unsigned char events = 0;
191 
192  if ((afd_poll_info->Handles[0].Events & (AFD_POLL_RECEIVE |
194  events |= UV_READABLE;
195  if ((afd_poll_info->Handles[0].Events & AFD_POLL_DISCONNECT) != 0) {
196  events |= UV_DISCONNECT;
197  }
198  }
199  if ((afd_poll_info->Handles[0].Events & (AFD_POLL_SEND |
200  AFD_POLL_CONNECT_FAIL)) != 0) {
201  events |= UV_WRITABLE;
202  }
203 
204  events &= handle->events & ~mask_events;
205 
206  if (afd_poll_info->Handles[0].Events & AFD_POLL_LOCAL_CLOSE) {
207  /* Stop polling. */
208  handle->events = 0;
209  if (uv__is_active(handle))
211  }
212 
213  if (events != 0) {
214  handle->poll_cb(handle, 0, events);
215  }
216  }
217 
218  if ((handle->events & ~(handle->submitted_events_1 |
219  handle->submitted_events_2)) != 0) {
221  } else if ((handle->flags & UV_HANDLE_CLOSING) &&
222  handle->submitted_events_1 == 0 &&
223  handle->submitted_events_2 == 0) {
225  }
226 }
227 
228 
229 static int uv__fast_poll_set(uv_loop_t* loop, uv_poll_t* handle, int events) {
230  assert(handle->type == UV_POLL);
231  assert(!(handle->flags & UV_HANDLE_CLOSING));
232  assert((events & ~(UV_READABLE | UV_WRITABLE | UV_DISCONNECT)) == 0);
233 
234  handle->events = events;
235 
236  if (handle->events != 0) {
238  } else {
240  }
241 
242  if ((handle->events & ~(handle->submitted_events_1 |
243  handle->submitted_events_2)) != 0) {
245  }
246 
247  return 0;
248 }
249 
250 
252  handle->events = 0;
254 
255  if (handle->submitted_events_1 == 0 &&
256  handle->submitted_events_2 == 0) {
258  return 0;
259  } else {
260  /* Cancel outstanding poll requests by executing another, unique poll
261  * request that forces the outstanding ones to return. */
263  }
264 }
265 
266 
267 static SOCKET uv__fast_poll_create_peer_socket(HANDLE iocp,
268  WSAPROTOCOL_INFOW* protocol_info) {
269  SOCKET sock = 0;
270 
271  sock = WSASocketW(protocol_info->iAddressFamily,
272  protocol_info->iSocketType,
273  protocol_info->iProtocol,
274  protocol_info,
275  0,
276  WSA_FLAG_OVERLAPPED);
277  if (sock == INVALID_SOCKET) {
278  return INVALID_SOCKET;
279  }
280 
281  if (!SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0)) {
282  goto error;
283  };
284 
285  if (CreateIoCompletionPort((HANDLE) sock,
286  iocp,
287  (ULONG_PTR) sock,
288  0) == NULL) {
289  goto error;
290  }
291 
292  return sock;
293 
294  error:
295  closesocket(sock);
296  return INVALID_SOCKET;
297 }
298 
299 
301  WSAPROTOCOL_INFOW* protocol_info) {
302  int index, i;
303  SOCKET peer_socket;
304 
305  index = -1;
306  for (i = 0; (size_t) i < ARRAY_SIZE(uv_msafd_provider_ids); i++) {
307  if (memcmp((void*) &protocol_info->ProviderId,
308  (void*) &uv_msafd_provider_ids[i],
309  sizeof protocol_info->ProviderId) == 0) {
310  index = i;
311  }
312  }
313 
314  /* Check if the protocol uses an msafd socket. */
315  if (index < 0) {
316  return INVALID_SOCKET;
317  }
318 
319  /* If we didn't (try) to create a peer socket yet, try to make one. Don't try
320  * again if the peer socket creation failed earlier for the same protocol. */
321  peer_socket = loop->poll_peer_sockets[index];
322  if (peer_socket == 0) {
323  peer_socket = uv__fast_poll_create_peer_socket(loop->iocp, protocol_info);
324  loop->poll_peer_sockets[index] = peer_socket;
325  }
326 
327  return peer_socket;
328 }
329 
330 
331 static DWORD WINAPI uv__slow_poll_thread_proc(void* arg) {
332  uv_req_t* req = (uv_req_t*) arg;
333  uv_poll_t* handle = (uv_poll_t*) req->data;
334  unsigned char reported_events;
335  int r;
336  uv_single_fd_set_t rfds, wfds, efds;
337  struct timeval timeout;
338 
339  assert(handle->type == UV_POLL);
340  assert(req->type == UV_POLL_REQ);
341 
342  if (handle->events & UV_READABLE) {
343  rfds.fd_count = 1;
344  rfds.fd_array[0] = handle->socket;
345  } else {
346  rfds.fd_count = 0;
347  }
348 
349  if (handle->events & UV_WRITABLE) {
350  wfds.fd_count = 1;
351  wfds.fd_array[0] = handle->socket;
352  efds.fd_count = 1;
353  efds.fd_array[0] = handle->socket;
354  } else {
355  wfds.fd_count = 0;
356  efds.fd_count = 0;
357  }
358 
359  /* Make the select() time out after 3 minutes. If select() hangs because the
360  * user closed the socket, we will at least not hang indefinitely. */
361  timeout.tv_sec = 3 * 60;
362  timeout.tv_usec = 0;
363 
364  r = select(1, (fd_set*) &rfds, (fd_set*) &wfds, (fd_set*) &efds, &timeout);
365  if (r == SOCKET_ERROR) {
366  /* Queue this req, reporting an error. */
367  SET_REQ_ERROR(&handle->poll_req_1, WSAGetLastError());
369  return 0;
370  }
371 
372  reported_events = 0;
373 
374  if (r > 0) {
375  if (rfds.fd_count > 0) {
376  assert(rfds.fd_count == 1);
377  assert(rfds.fd_array[0] == handle->socket);
378  reported_events |= UV_READABLE;
379  }
380 
381  if (wfds.fd_count > 0) {
382  assert(wfds.fd_count == 1);
383  assert(wfds.fd_array[0] == handle->socket);
384  reported_events |= UV_WRITABLE;
385  } else if (efds.fd_count > 0) {
386  assert(efds.fd_count == 1);
387  assert(efds.fd_array[0] == handle->socket);
388  reported_events |= UV_WRITABLE;
389  }
390  }
391 
393  req->u.io.overlapped.InternalHigh = (DWORD) reported_events;
395 
396  return 0;
397 }
398 
399 
401  uv_req_t* req;
402 
403  /* Find a yet unsubmitted req to submit. */
404  if (handle->submitted_events_1 == 0) {
405  req = &handle->poll_req_1;
406  handle->submitted_events_1 = handle->events;
407  handle->mask_events_1 = 0;
408  handle->mask_events_2 = handle->events;
409  } else if (handle->submitted_events_2 == 0) {
410  req = &handle->poll_req_2;
411  handle->submitted_events_2 = handle->events;
412  handle->mask_events_1 = handle->events;
413  handle->mask_events_2 = 0;
414  } else {
415  assert(0);
416  return;
417  }
418 
419  if (!QueueUserWorkItem(uv__slow_poll_thread_proc,
420  (void*) req,
421  WT_EXECUTELONGFUNCTION)) {
422  /* Make this req pending, reporting an error. */
423  SET_REQ_ERROR(req, GetLastError());
425  }
426 }
427 
428 
429 
431  uv_req_t* req) {
432  unsigned char mask_events;
433  int err;
434 
435  if (req == &handle->poll_req_1) {
436  handle->submitted_events_1 = 0;
437  mask_events = handle->mask_events_1;
438  } else if (req == &handle->poll_req_2) {
439  handle->submitted_events_2 = 0;
440  mask_events = handle->mask_events_2;
441  } else {
442  assert(0);
443  return;
444  }
445 
446  if (!REQ_SUCCESS(req)) {
447  /* Error. */
448  if (handle->events != 0) {
449  err = GET_REQ_ERROR(req);
450  handle->events = 0; /* Stop the watcher */
451  handle->poll_cb(handle, uv_translate_sys_error(err), 0);
452  }
453  } else {
454  /* Got some events. */
455  int events = req->u.io.overlapped.InternalHigh & handle->events & ~mask_events;
456  if (events != 0) {
457  handle->poll_cb(handle, 0, events);
458  }
459  }
460 
461  if ((handle->events & ~(handle->submitted_events_1 |
462  handle->submitted_events_2)) != 0) {
464  } else if ((handle->flags & UV_HANDLE_CLOSING) &&
465  handle->submitted_events_1 == 0 &&
466  handle->submitted_events_2 == 0) {
468  }
469 }
470 
471 
472 static int uv__slow_poll_set(uv_loop_t* loop, uv_poll_t* handle, int events) {
473  assert(handle->type == UV_POLL);
474  assert(!(handle->flags & UV_HANDLE_CLOSING));
475  assert((events & ~(UV_READABLE | UV_WRITABLE)) == 0);
476 
477  handle->events = events;
478 
479  if (handle->events != 0) {
481  } else {
483  }
484 
485  if ((handle->events &
486  ~(handle->submitted_events_1 | handle->submitted_events_2)) != 0) {
488  }
489 
490  return 0;
491 }
492 
493 
495  handle->events = 0;
497 
498  if (handle->submitted_events_1 == 0 &&
499  handle->submitted_events_2 == 0) {
501  }
502 
503  return 0;
504 }
505 
506 
508  return uv_poll_init_socket(loop, handle, (SOCKET) uv__get_osfhandle(fd));
509 }
510 
511 
514  WSAPROTOCOL_INFOW protocol_info;
515  int len;
516  SOCKET peer_socket, base_socket;
517  DWORD bytes;
518  DWORD yes = 1;
519 
520  /* Set the socket to nonblocking mode */
521  if (ioctlsocket(socket, FIONBIO, &yes) == SOCKET_ERROR)
522  return uv_translate_sys_error(WSAGetLastError());
523 
524 /* Try to obtain a base handle for the socket. This increases this chances that
525  * we find an AFD handle and are able to use the fast poll mechanism. This will
526  * always fail on windows XP/2k3, since they don't support the. SIO_BASE_HANDLE
527  * ioctl. */
528 #ifndef NDEBUG
529  base_socket = INVALID_SOCKET;
530 #endif
531 
532  if (WSAIoctl(socket,
534  NULL,
535  0,
536  &base_socket,
537  sizeof base_socket,
538  &bytes,
539  NULL,
540  NULL) == 0) {
541  assert(base_socket != 0 && base_socket != INVALID_SOCKET);
542  socket = base_socket;
543  }
544 
545  uv__handle_init(loop, (uv_handle_t*) handle, UV_POLL);
546  handle->socket = socket;
547  handle->events = 0;
548 
549  /* Obtain protocol information about the socket. */
550  len = sizeof protocol_info;
551  if (getsockopt(socket,
552  SOL_SOCKET,
553  SO_PROTOCOL_INFOW,
554  (char*) &protocol_info,
555  &len) != 0) {
556  return uv_translate_sys_error(WSAGetLastError());
557  }
558 
559  /* Get the peer socket that is needed to enable fast poll. If the returned
560  * value is NULL, the protocol is not implemented by MSAFD and we'll have to
561  * use slow mode. */
562  peer_socket = uv__fast_poll_get_peer_socket(loop, &protocol_info);
563 
564  if (peer_socket != INVALID_SOCKET) {
565  /* Initialize fast poll specific fields. */
566  handle->peer_socket = peer_socket;
567  } else {
568  /* Initialize slow poll specific fields. */
569  handle->flags |= UV_HANDLE_POLL_SLOW;
570  }
571 
572  /* Initialize 2 poll reqs. */
573  handle->submitted_events_1 = 0;
574  UV_REQ_INIT(&handle->poll_req_1, UV_POLL_REQ);
575  handle->poll_req_1.data = handle;
576 
577  handle->submitted_events_2 = 0;
578  UV_REQ_INIT(&handle->poll_req_2, UV_POLL_REQ);
579  handle->poll_req_2.data = handle;
580 
581  return 0;
582 }
583 
584 
586  int err;
587 
588  if (!(handle->flags & UV_HANDLE_POLL_SLOW)) {
589  err = uv__fast_poll_set(handle->loop, handle, events);
590  } else {
591  err = uv__slow_poll_set(handle->loop, handle, events);
592  }
593 
594  if (err) {
595  return uv_translate_sys_error(err);
596  }
597 
598  handle->poll_cb = cb;
599 
600  return 0;
601 }
602 
603 
605  int err;
606 
607  if (!(handle->flags & UV_HANDLE_POLL_SLOW)) {
608  err = uv__fast_poll_set(handle->loop, handle, 0);
609  } else {
610  err = uv__slow_poll_set(handle->loop, handle, 0);
611  }
612 
613  return uv_translate_sys_error(err);
614 }
615 
616 
618  if (!(handle->flags & UV_HANDLE_POLL_SLOW)) {
620  } else {
622  }
623 }
624 
625 
627  if (!(handle->flags & UV_HANDLE_POLL_SLOW)) {
629  } else {
631  }
632 }
633 
634 
636  assert(handle->flags & UV_HANDLE_CLOSING);
637  assert(!(handle->flags & UV_HANDLE_CLOSED));
638 
639  assert(handle->submitted_events_1 == 0);
640  assert(handle->submitted_events_2 == 0);
641 
643 }
uv__is_active
#define uv__is_active(h)
Definition: uv-common.h:235
TRUE
const BOOL TRUE
Definition: undname.c:48
async_greeter_server_with_graceful_shutdown.loop
loop
Definition: async_greeter_server_with_graceful_shutdown.py:59
AFD_POLL_RECEIVE
#define AFD_POLL_RECEIVE
Definition: winsock.h:97
REQ_SUCCESS
#define REQ_SUCCESS(req)
Definition: req-inl.h:46
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
_AFD_POLL_HANDLE_INFO::Events
ULONG Events
Definition: win.h:208
uv__fast_poll_set
static int uv__fast_poll_set(uv_loop_t *loop, uv_poll_t *handle, int events)
Definition: win/poll.c:229
UV_HANDLE_CLOSED
@ UV_HANDLE_CLOSED
Definition: uv-common.h:67
ARRAY_SIZE
#define ARRAY_SIZE(array)
Definition: bloaty.cc:101
AFD_POLL_ACCEPT
#define AFD_POLL_ACCEPT
Definition: winsock.h:111
memset
return memset(p, 0, total)
uv_poll_close
int uv_poll_close(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:626
UV_WRITABLE
@ UV_WRITABLE
Definition: uv.h:791
INT64_MAX
#define INT64_MAX
Definition: stdint-msvc2008.h:139
AFD_POLL_ABORT
#define AFD_POLL_ABORT
Definition: winsock.h:105
uv__fast_poll_process_poll_req
static void uv__fast_poll_process_poll_req(uv_loop_t *loop, uv_poll_t *handle, uv_req_t *req)
Definition: win/poll.c:163
POST_COMPLETION_FOR_REQ
#define POST_COMPLETION_FOR_REQ(loop, req)
Definition: req-inl.h:76
_AFD_POLL_INFO::Timeout
LARGE_INTEGER Timeout
Definition: win.h:213
uv__fast_poll_cancel_poll_req
static int uv__fast_poll_cancel_poll_req(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:137
error
grpc_error_handle error
Definition: retry_filter.cc:499
error_ref_leak.err
err
Definition: error_ref_leak.py:35
uv__handle_close
#define uv__handle_close(handle)
Definition: handle-inl.h:76
uv_single_fd_set_s::fd_count
unsigned int fd_count
Definition: win/poll.c:41
GET_REQ_ERROR
#define GET_REQ_ERROR(req)
Definition: req-inl.h:49
uv_poll_endgame
void uv_poll_endgame(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:635
UV_HANDLE_POLL_SLOW
@ UV_HANDLE_POLL_SLOW
Definition: uv-common.h:124
uv_want_endgame
static INLINE void uv_want_endgame(uv_loop_t *loop, uv_handle_t *handle)
Definition: handle-inl.h:88
overlapped_dummy_
static OVERLAPPED overlapped_dummy_
Definition: win/poll.c:46
uv_poll_cb
void(* uv_poll_cb)(uv_poll_t *handle, int status, int events)
Definition: uv.h:317
AFD_POLL_SEND
#define AFD_POLL_SEND
Definition: winsock.h:101
uv__fast_poll_create_peer_socket
static SOCKET uv__fast_poll_create_peer_socket(HANDLE iocp, WSAPROTOCOL_INFOW *protocol_info)
Definition: win/poll.c:267
SIO_BASE_HANDLE
#define SIO_BASE_HANDLE
Definition: winsock.h:54
uv_os_sock_t
int uv_os_sock_t
Definition: unix.h:127
uv_msafd_poll
int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO *info_in, AFD_POLL_INFO *info_out, OVERLAPPED *overlapped)
Definition: winsock.c:461
_AFD_POLL_HANDLE_INFO::Handle
HANDLE Handle
Definition: win.h:207
req-inl.h
uv__handle_closing
#define uv__handle_closing(handle)
Definition: handle-inl.h:63
uv__slow_poll_set
static int uv__slow_poll_set(uv_loop_t *loop, uv_poll_t *handle, int events)
Definition: win/poll.c:472
uv_poll_init
int uv_poll_init(uv_loop_t *loop, uv_poll_t *handle, int fd)
Definition: win/poll.c:507
_AFD_POLL_INFO::Handles
AFD_POLL_HANDLE_INFO Handles[1]
Definition: win.h:216
uv__get_overlapped_dummy
static OVERLAPPED * uv__get_overlapped_dummy(void)
Definition: win/poll.c:64
uv_once
UV_EXTERN void uv_once(uv_once_t *guard, void(*callback)(void))
Definition: libuv/src/unix/thread.c:418
SET_REQ_SUCCESS
#define SET_REQ_SUCCESS(req)
Definition: req-inl.h:40
req
static uv_connect_t req
Definition: test-connection-fail.c:30
uv_translate_sys_error
UV_EXTERN int uv_translate_sys_error(int sys_errno)
Definition: unix/core.c:1244
SET_REQ_ERROR
#define SET_REQ_ERROR(req, error)
Definition: req-inl.h:34
uv__get_afd_poll_info_dummy
static AFD_POLL_INFO * uv__get_afd_poll_info_dummy(void)
Definition: win/poll.c:70
uv_msafd_provider_ids
static const GUID uv_msafd_provider_ids[UV_MSAFD_PROVIDER_COUNT]
Definition: win/poll.c:31
AFD_POLL_CONNECT_FAIL
#define AFD_POLL_CONNECT_FAIL
Definition: winsock.h:113
arg
Definition: cmdline.cc:40
uv_once_t
pthread_once_t uv_once_t
Definition: unix.h:133
uv_poll_init_socket
int uv_poll_init_socket(uv_loop_t *loop, uv_poll_t *handle, uv_os_sock_t socket)
Definition: win/poll.c:512
uv__fast_poll_close
static int uv__fast_poll_close(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:251
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
UV_READABLE
@ UV_READABLE
Definition: uv.h:790
uv_single_fd_set_s::fd_array
SOCKET fd_array[1]
Definition: win/poll.c:42
uv__handle_init
#define uv__handle_init(loop_, h, type_)
Definition: uv-common.h:284
uv_poll_start
int uv_poll_start(uv_poll_t *handle, int events, uv_poll_cb cb)
Definition: win/poll.c:585
uv_insert_pending_req
static INLINE void uv_insert_pending_req(uv_loop_t *loop, uv_req_t *req)
Definition: req-inl.h:90
uv_fatal_error
void uv_fatal_error(const int errorno, const char *syscall)
Definition: error.c:35
uv.h
AFD_POLL_LOCAL_CLOSE
#define AFD_POLL_LOCAL_CLOSE
Definition: winsock.h:107
UV_REQ_INIT
#define UV_REQ_INIT(req, typ)
Definition: uv-common.h:305
UV_HANDLE_CLOSING
@ UV_HANDLE_CLOSING
Definition: uv-common.h:66
uv_single_fd_set_t
struct uv_single_fd_set_s uv_single_fd_set_t
uv__slow_poll_submit_poll_req
static void uv__slow_poll_submit_poll_req(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:400
uv__init_overlapped_dummy
static void uv__init_overlapped_dummy(void)
Definition: win/poll.c:52
uv_poll_s
Definition: uv.h:783
uv_process_poll_req
void uv_process_poll_req(uv_loop_t *loop, uv_poll_t *handle, uv_req_t *req)
Definition: win/poll.c:617
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
uv__fast_poll_submit_poll_req
static void uv__fast_poll_submit_poll_req(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:75
AFD_POLL_DISCONNECT
#define AFD_POLL_DISCONNECT
Definition: winsock.h:103
uv__slow_poll_close
static int uv__slow_poll_close(uv_loop_t *loop, uv_poll_t *handle)
Definition: win/poll.c:494
uv_poll_stop
int uv_poll_stop(uv_poll_t *handle)
Definition: win/poll.c:604
timeval
Definition: setup_once.h:113
GET_REQ_SOCK_ERROR
#define GET_REQ_SOCK_ERROR(req)
Definition: req-inl.h:52
afd_poll_info_dummy_
static AFD_POLL_INFO afd_poll_info_dummy_
Definition: win/poll.c:49
uv__get_osfhandle
static INLINE HANDLE uv__get_osfhandle(int fd)
Definition: handle-inl.h:166
_AFD_POLL_INFO::NumberOfHandles
ULONG NumberOfHandles
Definition: win.h:214
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
fix_build_deps.r
r
Definition: fix_build_deps.py:491
UV_MSAFD_PROVIDER_COUNT
#define UV_MSAFD_PROVIDER_COUNT
Definition: win.h:219
UV_ONCE_INIT
#define UV_ONCE_INIT
Definition: unix.h:131
uv__fast_poll_get_peer_socket
static SOCKET uv__fast_poll_get_peer_socket(uv_loop_t *loop, WSAPROTOCOL_INFOW *protocol_info)
Definition: win/poll.c:300
handle
static csh handle
Definition: test_arm_regression.c:16
uv_handle_s
Definition: uv.h:441
uv__slow_poll_process_poll_req
static void uv__slow_poll_process_poll_req(uv_loop_t *loop, uv_poll_t *handle, uv_req_t *req)
Definition: win/poll.c:430
UV_DISCONNECT
@ UV_DISCONNECT
Definition: uv.h:792
test_server.socket
socket
Definition: test_server.py:65
closesocket
static int closesocket(int sock)
Definition: bio_test.cc:46
uv_loop_s
Definition: uv.h:1767
internal.h
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
uv__handle_start
#define uv__handle_start(h)
Definition: uv-common.h:241
_AFD_POLL_HANDLE_INFO::Status
NTSTATUS Status
Definition: win.h:209
uv__slow_poll_thread_proc
static DWORD WINAPI uv__slow_poll_thread_proc(void *arg)
Definition: win/poll.c:331
_AFD_POLL_INFO
Definition: win.h:212
handle-inl.h
uv__handle_stop
#define uv__handle_stop(h)
Definition: uv-common.h:249
uv_req_s
Definition: uv.h:404
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
timeout
uv_timer_t timeout
Definition: libuv/docs/code/uvwget/main.c:9
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
_AFD_POLL_INFO::Exclusive
ULONG Exclusive
Definition: win.h:215
uv_single_fd_set_s
Definition: win/poll.c:40
AFD_POLL_ALL
#define AFD_POLL_ALL
Definition: winsock.h:120
overlapped_dummy_init_guard_
static uv_once_t overlapped_dummy_init_guard_
Definition: win/poll.c:47


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:44