test-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 <errno.h>
23 
24 #ifdef _WIN32
25 # include <fcntl.h>
26 #else
27 # include <sys/socket.h>
28 # include <unistd.h>
29 #endif
30 
31 #include "uv.h"
32 #include "task.h"
33 
34 #ifdef __linux__
35 # include <sys/epoll.h>
36 #endif
37 
38 #ifdef UV_HAVE_KQUEUE
39 # include <sys/types.h>
40 # include <sys/event.h>
41 # include <sys/time.h>
42 #endif
43 
44 
45 #define NUM_CLIENTS 5
46 #define TRANSFER_BYTES (1 << 16)
47 
48 #undef MIN
49 #define MIN(a, b) (((a) < (b)) ? (a) : (b));
50 
51 
52 typedef enum {
55 } test_mode_t;
56 
57 typedef struct connection_context_s {
61  size_t read, sent;
65  unsigned int events, delayed_events;
67 
68 typedef struct server_context_s {
73 
74 
75 static void delay_timer_cb(uv_timer_t* timer);
76 
77 
79 
80 static int closed_connections = 0;
81 
82 static int valid_writable_wakeups = 0;
84 
85 #if !defined(__sun) && !defined(_AIX) && !defined(__MVS__)
86 static int disconnects = 0;
87 #endif /* !__sun && !_AIX && !__MVS__ */
88 
89 static int got_eagain(void) {
90 #ifdef _WIN32
91  return WSAGetLastError() == WSAEWOULDBLOCK;
92 #else
93  return errno == EAGAIN
94  || errno == EINPROGRESS
95 #ifdef EWOULDBLOCK
96  || errno == EWOULDBLOCK;
97 #endif
98  ;
99 #endif
100 }
101 
102 
103 static uv_os_sock_t create_bound_socket (struct sockaddr_in bind_addr) {
104  uv_os_sock_t sock;
105  int r;
106 
107  sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
108 #ifdef _WIN32
109  ASSERT(sock != INVALID_SOCKET);
110 #else
111  ASSERT(sock >= 0);
112 #endif
113 
114 #ifndef _WIN32
115  {
116  /* Allow reuse of the port. */
117  int yes = 1;
118  r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof yes);
119  ASSERT(r == 0);
120  }
121 #endif
122 
123  r = bind(sock, (const struct sockaddr*) &bind_addr, sizeof bind_addr);
124  ASSERT(r == 0);
125 
126  return sock;
127 }
128 
129 
130 static void close_socket(uv_os_sock_t sock) {
131  int r;
132 #ifdef _WIN32
133  r = closesocket(sock);
134 #else
135  r = close(sock);
136 #endif
137  /* On FreeBSD close() can fail with ECONNRESET if the socket was shutdown by
138  * the peer before all pending data was delivered.
139  */
140  ASSERT(r == 0 || errno == ECONNRESET);
141 }
142 
143 
145  uv_os_sock_t sock, int is_server_connection) {
146  int r;
148 
149  context = (connection_context_t*) malloc(sizeof *context);
150  ASSERT(context != NULL);
151 
152  context->sock = sock;
153  context->is_server_connection = is_server_connection;
154  context->read = 0;
155  context->sent = 0;
156  context->open_handles = 0;
157  context->events = 0;
158  context->delayed_events = 0;
159  context->got_fin = 0;
160  context->sent_fin = 0;
161  context->got_disconnect = 0;
162 
163  r = uv_poll_init_socket(uv_default_loop(), &context->poll_handle, sock);
164  context->open_handles++;
165  context->poll_handle.data = context;
166  ASSERT(r == 0);
167 
168  r = uv_timer_init(uv_default_loop(), &context->timer_handle);
169  context->open_handles++;
170  context->timer_handle.data = context;
171  ASSERT(r == 0);
172 
173  return context;
174 }
175 
176 
179 
180  if (--context->open_handles == 0) {
181  if (test_mode == DUPLEX || context->is_server_connection) {
182  ASSERT(context->read == TRANSFER_BYTES);
183  } else {
184  ASSERT(context->read == 0);
185  }
186 
187  if (test_mode == DUPLEX || !context->is_server_connection) {
188  ASSERT(context->sent == TRANSFER_BYTES);
189  } else {
190  ASSERT(context->sent == 0);
191  }
192 
194 
195  free(context);
196  }
197 }
198 
199 
201  uv_close((uv_handle_t*) &context->poll_handle, connection_close_cb);
202  uv_close((uv_handle_t*) &context->timer_handle, connection_close_cb);
203 }
204 
205 
206 static void connection_poll_cb(uv_poll_t* handle, int status, int events) {
208  unsigned int new_events;
209  int r;
210 
211  ASSERT(status == 0);
212  ASSERT(events & context->events);
213  ASSERT(!(events & ~context->events));
214 
215  new_events = context->events;
216 
217  if (events & UV_READABLE) {
218  int action = rand() % 7;
219 
220  switch (action) {
221  case 0:
222  case 1: {
223  /* Read a couple of bytes. */
224  static char buffer[74];
225 
226  do
227  r = recv(context->sock, buffer, sizeof buffer, 0);
228  while (r == -1 && errno == EINTR);
229  ASSERT(r >= 0);
230 
231  if (r > 0) {
232  context->read += r;
233  } else {
234  /* Got FIN. */
235  context->got_fin = 1;
236  new_events &= ~UV_READABLE;
237  }
238 
239  break;
240  }
241 
242  case 2:
243  case 3: {
244  /* Read until EAGAIN. */
245  static char buffer[931];
246 
247  for (;;) {
248  do
249  r = recv(context->sock, buffer, sizeof buffer, 0);
250  while (r == -1 && errno == EINTR);
251 
252  if (r <= 0)
253  break;
254 
255  context->read += r;
256  }
257 
258  if (r == 0) {
259  /* Got FIN. */
260  context->got_fin = 1;
261  new_events &= ~UV_READABLE;
262  } else {
263  ASSERT(got_eagain());
264  }
265 
266  break;
267  }
268 
269  case 4:
270  /* Ignore. */
271  break;
272 
273  case 5:
274  /* Stop reading for a while. Restart in timer callback. */
275  new_events &= ~UV_READABLE;
276  if (!uv_is_active((uv_handle_t*) &context->timer_handle)) {
277  context->delayed_events = UV_READABLE;
278  uv_timer_start(&context->timer_handle, delay_timer_cb, 10, 0);
279  } else {
280  context->delayed_events |= UV_READABLE;
281  }
282  break;
283 
284  case 6:
285  /* Fudge with the event mask. */
288  context->events = UV_READABLE;
289  break;
290 
291  default:
292  ASSERT(0);
293  }
294  }
295 
296  if (events & UV_WRITABLE) {
297  if (context->sent < TRANSFER_BYTES &&
298  !(test_mode == UNIDIRECTIONAL && context->is_server_connection)) {
299  /* We have to send more bytes. */
300  int action = rand() % 7;
301 
302  switch (action) {
303  case 0:
304  case 1: {
305  /* Send a couple of bytes. */
306  static char buffer[103];
307 
308  int send_bytes = MIN(TRANSFER_BYTES - context->sent, sizeof buffer);
309  ASSERT(send_bytes > 0);
310 
311  do
312  r = send(context->sock, buffer, send_bytes, 0);
313  while (r == -1 && errno == EINTR);
314 
315  if (r < 0) {
316  ASSERT(got_eagain());
318  break;
319  }
320 
321  ASSERT(r > 0);
322  context->sent += r;
324  break;
325  }
326 
327  case 2:
328  case 3: {
329  /* Send until EAGAIN. */
330  static char buffer[1234];
331 
332  int send_bytes = MIN(TRANSFER_BYTES - context->sent, sizeof buffer);
333  ASSERT(send_bytes > 0);
334 
335  do
336  r = send(context->sock, buffer, send_bytes, 0);
337  while (r == -1 && errno == EINTR);
338 
339  if (r < 0) {
340  ASSERT(got_eagain());
342  break;
343  }
344 
345  ASSERT(r > 0);
347  context->sent += r;
348 
349  while (context->sent < TRANSFER_BYTES) {
350  send_bytes = MIN(TRANSFER_BYTES - context->sent, sizeof buffer);
351  ASSERT(send_bytes > 0);
352 
353  do
354  r = send(context->sock, buffer, send_bytes, 0);
355  while (r == -1 && errno == EINTR);
356  ASSERT(r != 0);
357 
358  if (r < 0) {
359  ASSERT(got_eagain());
360  break;
361  }
362 
363  context->sent += r;
364  }
365  break;
366  }
367 
368  case 4:
369  /* Ignore. */
370  break;
371 
372  case 5:
373  /* Stop sending for a while. Restart in timer callback. */
374  new_events &= ~UV_WRITABLE;
375  if (!uv_is_active((uv_handle_t*) &context->timer_handle)) {
376  context->delayed_events = UV_WRITABLE;
377  uv_timer_start(&context->timer_handle, delay_timer_cb, 100, 0);
378  } else {
379  context->delayed_events |= UV_WRITABLE;
380  }
381  break;
382 
383  case 6:
384  /* Fudge with the event mask. */
385  uv_poll_start(&context->poll_handle,
386  UV_READABLE,
388  uv_poll_start(&context->poll_handle,
389  UV_WRITABLE,
391  context->events = UV_WRITABLE;
392  break;
393 
394  default:
395  ASSERT(0);
396  }
397 
398  } else {
399  /* Nothing more to write. Send FIN. */
400  int r;
401 #ifdef _WIN32
402  r = shutdown(context->sock, SD_SEND);
403 #else
404  r = shutdown(context->sock, SHUT_WR);
405 #endif
406  ASSERT(r == 0);
407  context->sent_fin = 1;
408  new_events &= ~UV_WRITABLE;
409  }
410  }
411 #if !defined(__sun) && !defined(_AIX) && !defined(__MVS__)
412  if (events & UV_DISCONNECT) {
413  context->got_disconnect = 1;
414  ++disconnects;
415  new_events &= ~UV_DISCONNECT;
416  }
417 
418  if (context->got_fin && context->sent_fin && context->got_disconnect) {
419 #else /* __sun && _AIX && __MVS__ */
420  if (context->got_fin && context->sent_fin) {
421 #endif /* !__sun && !_AIX && !__MVS__ */
422  /* Sent and received FIN. Close and destroy context. */
423  close_socket(context->sock);
425  context->events = 0;
426 
427  } else if (new_events != context->events) {
428  /* Poll mask changed. Call uv_poll_start again. */
429  context->events = new_events;
431  }
432 
433  /* Assert that uv_is_active works correctly for poll handles. */
434  if (context->events != 0) {
436  } else {
438  }
439 }
440 
441 
444  int r;
445 
446  /* Timer should auto stop. */
448 
449  /* Add the requested events to the poll mask. */
450  ASSERT(context->delayed_events != 0);
451  context->events |= context->delayed_events;
452  context->delayed_events = 0;
453 
454  r = uv_poll_start(&context->poll_handle,
455  context->events,
457  ASSERT(r == 0);
458 }
459 
460 
462  uv_os_sock_t sock) {
463  int r;
465 
466  context = (server_context_t*) malloc(sizeof *context);
467  ASSERT(context != NULL);
468 
469  context->sock = sock;
470  context->connections = 0;
471 
472  r = uv_poll_init_socket(uv_default_loop(), &context->poll_handle, sock);
473  context->poll_handle.data = context;
474  ASSERT(r == 0);
475 
476  return context;
477 }
478 
479 
482  free(context);
483 }
484 
485 
487  uv_close((uv_handle_t*) &context->poll_handle, server_close_cb);
488 }
489 
490 
491 static void server_poll_cb(uv_poll_t* handle, int status, int events) {
492  server_context_t* server_context = (server_context_t*)
493  handle->data;
494  connection_context_t* connection_context;
495  struct sockaddr_in addr;
496  socklen_t addr_len;
497  uv_os_sock_t sock;
498  int r;
499 
500  addr_len = sizeof addr;
501  sock = accept(server_context->sock, (struct sockaddr*) &addr, &addr_len);
502 #ifdef _WIN32
503  ASSERT(sock != INVALID_SOCKET);
504 #else
505  ASSERT(sock >= 0);
506 #endif
507 
508  connection_context = create_connection_context(sock, 1);
509  connection_context->events = UV_READABLE | UV_WRITABLE | UV_DISCONNECT;
510  r = uv_poll_start(&connection_context->poll_handle,
513  ASSERT(r == 0);
514 
515  if (++server_context->connections == NUM_CLIENTS) {
516  close_socket(server_context->sock);
517  destroy_server_context(server_context);
518  }
519 }
520 
521 
522 static void start_server(void) {
524  struct sockaddr_in addr;
525  uv_os_sock_t sock;
526  int r;
527 
528  ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));
529  sock = create_bound_socket(addr);
531 
532  r = listen(sock, 100);
533  ASSERT(r == 0);
534 
535  r = uv_poll_start(&context->poll_handle, UV_READABLE, server_poll_cb);
536  ASSERT(r == 0);
537 }
538 
539 
540 static void start_client(void) {
541  uv_os_sock_t sock;
543  struct sockaddr_in server_addr;
544  struct sockaddr_in addr;
545  int r;
546 
547  ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr));
548  ASSERT(0 == uv_ip4_addr("0.0.0.0", 0, &addr));
549 
550  sock = create_bound_socket(addr);
552 
554  r = uv_poll_start(&context->poll_handle,
557  ASSERT(r == 0);
558 
559  r = connect(sock, (struct sockaddr*) &server_addr, sizeof server_addr);
560  ASSERT(r == 0 || got_eagain());
561 }
562 
563 
564 static void start_poll_test(void) {
565  int i, r;
566 
567 #ifdef _WIN32
568  {
569  struct WSAData wsa_data;
570  int r = WSAStartup(MAKEWORD(2, 2), &wsa_data);
571  ASSERT(r == 0);
572  }
573 #endif
574 
575  start_server();
576 
577  for (i = 0; i < NUM_CLIENTS; i++)
578  start_client();
579 
581  ASSERT(r == 0);
582 
583  /* Assert that at most five percent of the writable wakeups was spurious. */
587 
589 #if !defined(__sun) && !defined(_AIX) && !defined(__MVS__)
591 #endif
593 }
594 
595 
596 TEST_IMPL(poll_duplex) {
597 #if defined(NO_SELF_CONNECT)
598  RETURN_SKIP(NO_SELF_CONNECT);
599 #endif
600  test_mode = DUPLEX;
601  start_poll_test();
602  return 0;
603 }
604 
605 
606 TEST_IMPL(poll_unidirectional) {
607 #if defined(NO_SELF_CONNECT)
608  RETURN_SKIP(NO_SELF_CONNECT);
609 #endif
611  start_poll_test();
612  return 0;
613 }
614 
615 
616 /* Windows won't let you open a directory so we open a file instead.
617  * OS X lets you poll a file so open the $PWD instead. Both fail
618  * on Linux so it doesn't matter which one we pick. Both succeed
619  * on FreeBSD, Solaris and AIX so skip the test on those platforms.
620  */
621 TEST_IMPL(poll_bad_fdtype) {
622 #if !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__sun) && \
623  !defined(_AIX) && !defined(__MVS__) && !defined(__FreeBSD_kernel__) && \
624  !defined(__OpenBSD__) && !defined(__CYGWIN__) && !defined(__MSYS__) && \
625  !defined(__NetBSD__)
627  int fd;
628 
629 #if defined(_WIN32)
630  fd = open("test/fixtures/empty_file", O_RDONLY);
631 #else
632  fd = open(".", O_RDONLY);
633 #endif
634  ASSERT(fd != -1);
636  ASSERT(0 == close(fd));
637 #endif
638 
640  return 0;
641 }
642 
643 
644 #ifdef __linux__
645 TEST_IMPL(poll_nested_epoll) {
647  int fd;
648 
649  fd = epoll_create(1);
650  ASSERT(fd != -1);
651 
655 
656  uv_close((uv_handle_t*) &poll_handle, NULL);
658  ASSERT(0 == close(fd));
659 
661  return 0;
662 }
663 #endif /* __linux__ */
664 
665 
666 #ifdef UV_HAVE_KQUEUE
667 TEST_IMPL(poll_nested_kqueue) {
669  int fd;
670 
671  fd = kqueue();
672  ASSERT(fd != -1);
673 
677 
678  uv_close((uv_handle_t*) &poll_handle, NULL);
680  ASSERT(0 == close(fd));
681 
683  return 0;
684 }
685 #endif /* UV_HAVE_KQUEUE */
delay_timer_cb
static void delay_timer_cb(uv_timer_t *timer)
Definition: test-poll.c:442
server_close_cb
static void server_close_cb(uv_handle_t *handle)
Definition: test-poll.c:480
server_context_s::sock
uv_os_sock_t sock
Definition: test-poll.c:70
server_context_s::poll_handle
uv_poll_t poll_handle
Definition: test-poll.c:69
connection_context_s::read
size_t read
Definition: test-poll.c:61
task.h
connection_context_s::open_handles
int open_handles
Definition: test-poll.c:63
disconnects
static int disconnects
Definition: test-poll.c:86
UV_WRITABLE
@ UV_WRITABLE
Definition: uv.h:791
uv_poll_init_socket
UV_EXTERN int uv_poll_init_socket(uv_loop_t *loop, uv_poll_t *handle, uv_os_sock_t socket)
Definition: unix/poll.c:96
UV_RUN_NOWAIT
@ UV_RUN_NOWAIT
Definition: uv.h:256
uv_poll_init
UV_EXTERN int uv_poll_init(uv_loop_t *loop, uv_poll_t *handle, int fd)
Definition: unix/poll.c:68
ASSERT
#define ASSERT(expr)
Definition: task.h:102
status
absl::Status status
Definition: rls.cc:251
DUPLEX
@ DUPLEX
Definition: test-poll.c:54
uv_run
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition: unix/core.c:361
connection_context_t
struct connection_context_s connection_context_t
create_connection_context
static connection_context_t * create_connection_context(uv_os_sock_t sock, int is_server_connection)
Definition: test-poll.c:144
uv_poll_cb
void(* uv_poll_cb)(uv_poll_t *handle, int status, int events)
Definition: uv.h:317
connection_context_s::is_server_connection
int is_server_connection
Definition: test-poll.c:62
uv_poll_start
UV_EXTERN int uv_poll_start(uv_poll_t *handle, int events, uv_poll_cb cb)
Definition: unix/poll.c:118
TEST_PORT
#define TEST_PORT
Definition: task.h:53
uv_close
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
Definition: unix/core.c:112
uv_os_sock_t
int uv_os_sock_t
Definition: unix.h:127
uv_ip4_addr
UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
Definition: uv-common.c:221
closed_connections
static int closed_connections
Definition: test-poll.c:80
TRANSFER_BYTES
#define TRANSFER_BYTES
Definition: test-poll.c:46
spurious_writable_wakeups
static int spurious_writable_wakeups
Definition: test-poll.c:83
NUM_CLIENTS
#define NUM_CLIENTS
Definition: test-poll.c:45
uv_default_loop
UV_EXTERN uv_loop_t * uv_default_loop(void)
Definition: uv-common.c:733
UNIDIRECTIONAL
@ UNIDIRECTIONAL
Definition: test-poll.c:53
create_server_context
static server_context_t * create_server_context(uv_os_sock_t sock)
Definition: test-poll.c:461
start_server
static void start_server(void)
Definition: test-poll.c:522
server_context_s::connections
int connections
Definition: test-poll.c:71
connection_context_s::sent
size_t sent
Definition: test-poll.c:61
UV_RUN_DEFAULT
@ UV_RUN_DEFAULT
Definition: uv.h:254
connection_context_s::sent_fin
int sent_fin
Definition: test-poll.c:64
server_poll_cb
static void server_poll_cb(uv_poll_t *handle, int status, int events)
Definition: test-poll.c:491
connection_context_s::events
unsigned int events
Definition: test-poll.c:65
uv_is_active
UV_EXTERN int uv_is_active(const uv_handle_t *handle)
Definition: unix/core.c:418
close
#define close
Definition: test-fs.c:48
start_client
static void start_client(void)
Definition: test-poll.c:540
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
test_mode_t
test_mode_t
Definition: test-poll.c:52
UV_READABLE
@ UV_READABLE
Definition: uv.h:790
uv_timer_s
Definition: uv.h:850
connection_context_s::poll_handle
uv_poll_t poll_handle
Definition: test-poll.c:58
connection_poll_cb
static void connection_poll_cb(uv_poll_t *handle, int status, int events)
Definition: test-poll.c:206
destroy_connection_context
static void destroy_connection_context(connection_context_t *context)
Definition: test-poll.c:200
server_context_t
struct server_context_s server_context_t
uv.h
MAKE_VALGRIND_HAPPY
#define MAKE_VALGRIND_HAPPY()
Definition: task.h:229
uv_poll_s
Definition: uv.h:783
server_context_s
Definition: test-poll.c:68
connection_context_s
Definition: test-poll.c:57
client.action
action
Definition: examples/python/xds/client.py:49
create_bound_socket
static uv_os_sock_t create_bound_socket(struct sockaddr_in bind_addr)
Definition: test-poll.c:103
http2_test_server.listen
def listen(endpoint, test_case)
Definition: http2_test_server.py:87
fix_build_deps.r
r
Definition: fix_build_deps.py:491
valid_writable_wakeups
static int valid_writable_wakeups
Definition: test-poll.c:82
got_eagain
static int got_eagain(void)
Definition: test-poll.c:89
destroy_server_context
static void destroy_server_context(server_context_t *context)
Definition: test-poll.c:486
connection_close_cb
static void connection_close_cb(uv_handle_t *handle)
Definition: test-poll.c:177
RETURN_SKIP
#define RETURN_SKIP(explanation)
Definition: task.h:262
open
#define open
Definition: test-fs.c:46
handle
static csh handle
Definition: test_arm_regression.c:16
connection_context_s::delayed_events
unsigned int delayed_events
Definition: test-poll.c:65
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
uv_handle_s
Definition: uv.h:441
UV_DISCONNECT
@ UV_DISCONNECT
Definition: uv.h:792
uv_timer_start
UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
Definition: timer.c:66
test_server.socket
socket
Definition: test_server.py:65
closesocket
static int closesocket(int sock)
Definition: bio_test.cc:46
connection_context_s::got_fin
int got_fin
Definition: test-poll.c:64
uv_timer_init
UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle)
Definition: timer.c:58
connection_context_s::got_disconnect
int got_disconnect
Definition: test-poll.c:64
poll_handle
static uv_fs_poll_t poll_handle
Definition: test-fs-poll.c:45
close_socket
static void close_socket(uv_os_sock_t sock)
Definition: test-poll.c:130
connection_context_s::timer_handle
uv_timer_t timer_handle
Definition: test-poll.c:59
connection_context_s::sock
uv_os_sock_t sock
Definition: test-poll.c:60
addr
struct sockaddr_in addr
Definition: libuv/docs/code/tcp-echo-server/main.c:10
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
MIN
#define MIN(a, b)
Definition: test-poll.c:49
errno.h
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
start_poll_test
static void start_poll_test(void)
Definition: test-poll.c:564
TEST_IMPL
TEST_IMPL(poll_duplex)
Definition: test-poll.c:596
timer
static uv_timer_t timer
Definition: test-callback-stack.c:34
test_mode
static test_mode_t test_mode
Definition: test-poll.c:78


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:26