/libuv/test/ |
H A D | test-udp-connect.c | 33 static uv_udp_t client; variable 68 uv_udp_connect(&client, NULL); in cl_send_cb() 72 &client, in cl_send_cb() 121 r = uv_udp_init(uv_default_loop(), &client); in TEST_IMPL() 133 r = uv_udp_connect(&client, NULL); in TEST_IMPL() 152 r = uv_udp_try_send(&client, &buf, 1, NULL); in TEST_IMPL() 157 r = uv_udp_connect(&client, NULL); in TEST_IMPL() 159 r = uv_udp_connect(&client, NULL); in TEST_IMPL() 169 r = uv_udp_try_send(&client, &buf, 1, NULL); in TEST_IMPL() 176 &client, in TEST_IMPL() [all …]
|
H A D | test-udp-connect6.c | 33 static uv_udp_t client; variable 68 uv_udp_connect(&client, NULL); in cl_send_cb() 72 &client, in cl_send_cb() 124 r = uv_udp_init(uv_default_loop(), &client); in TEST_IMPL() 136 r = uv_udp_connect(&client, NULL); in TEST_IMPL() 155 r = uv_udp_try_send(&client, &buf, 1, NULL); in TEST_IMPL() 160 r = uv_udp_connect(&client, NULL); in TEST_IMPL() 162 r = uv_udp_connect(&client, NULL); in TEST_IMPL() 172 r = uv_udp_try_send(&client, &buf, 1, NULL); in TEST_IMPL() 179 &client, in TEST_IMPL() [all …]
|
H A D | test-udp-create-socket-early.c | 37 uv_udp_t client; in TEST_IMPL() local 43 r = uv_udp_init_ex(uv_default_loop(), &client, AF_INET); in TEST_IMPL() 46 r = uv_fileno((const uv_handle_t*) &client, &fd); in TEST_IMPL() 70 uv_close((uv_handle_t*) &client, NULL); in TEST_IMPL() 80 uv_udp_t client; in TEST_IMPL() local 89 r = uv_udp_init_ex(uv_default_loop(), &client, AF_INET6); in TEST_IMPL() 92 r = uv_fileno((const uv_handle_t*) &client, &fd); in TEST_IMPL() 117 uv_close((uv_handle_t*) &client, NULL); in TEST_IMPL() 126 uv_udp_t client; in TEST_IMPL() local 129 r = uv_udp_init_ex(uv_default_loop(), &client, 47); in TEST_IMPL() [all …]
|
H A D | test-tcp-create-socket-early.c | 83 r = uv_tcp_init(loop, client); in tcp_connector() 87 client, in tcp_connector() 97 uv_tcp_t client; in TEST_IMPL() local 106 r = uv_fileno((const uv_handle_t*) &client, &fd); in TEST_IMPL() 130 uv_close((uv_handle_t*) &client, NULL); in TEST_IMPL() 140 uv_tcp_t client; in TEST_IMPL() local 152 r = uv_fileno((const uv_handle_t*) &client, &fd); in TEST_IMPL() 177 uv_close((uv_handle_t*) &client, NULL); in TEST_IMPL() 186 uv_tcp_t client; in TEST_IMPL() local 189 r = uv_tcp_init_ex(uv_default_loop(), &client, 47); in TEST_IMPL() [all …]
|
H A D | test-udp-open.c | 141 uv_udp_t client, client2; in TEST_IMPL() local 153 r = uv_udp_open(&client, sock); in TEST_IMPL() 163 &client, in TEST_IMPL() 197 uv_udp_t client; in TEST_IMPL() local 208 r = uv_udp_open(&client, sock1); in TEST_IMPL() 211 r = uv_udp_open(&client, sock2); in TEST_IMPL() 224 uv_udp_t client; in TEST_IMPL() local 239 r = uv_udp_open(&client, sock); in TEST_IMPL() 255 uv_udp_t client; in TEST_IMPL() local 271 r = uv_udp_open(&client, sock); in TEST_IMPL() [all …]
|
H A D | test-udp-sendmmsg-error.c | 30 static uv_udp_t client; variable 38 ASSERT_PTR_EQ(handle, &client); in close_cb() 49 uv_close((uv_handle_t*)&client, close_cb); in send_cb() 58 ASSERT_OK(uv_udp_init(uv_default_loop(), &client)); in TEST_IMPL() 60 ASSERT_OK(uv_udp_connect(&client, (const struct sockaddr*)&addr)); in TEST_IMPL() 64 ASSERT_OK(uv_udp_send(&req[i], &client, &buf, 1, NULL, send_cb)); in TEST_IMPL() 71 ASSERT_OK(client.send_queue_size); in TEST_IMPL()
|
H A D | test-tcp-open.c | 42 static uv_tcp_t client; variable 250 r = uv_tcp_open(&client, sock); in TEST_IMPL() 254 &client, in TEST_IMPL() 286 uv_tcp_t client; in TEST_IMPL() local 297 r = uv_tcp_open(&client, sock1); in TEST_IMPL() 300 r = uv_tcp_open(&client, sock2); in TEST_IMPL() 304 uv_close((uv_handle_t*) &client, NULL); in TEST_IMPL() 337 uv_tcp_t client; in TEST_IMPL() local 350 ASSERT_OK(uv_tcp_open(&client, sock)); in TEST_IMPL() 388 r = uv_tcp_open(&client, sock); in TEST_IMPL() [all …]
|
H A D | test-tcp-write-in-a-row.c | 30 static uv_tcp_t client; variable 48 ASSERT_OK(uv_stream_get_write_queue_size((uv_stream_t*) &client)); in write_cb() 54 uv_close((uv_handle_t*) &client, close_cb); in write_cb() 70 r = uv_write(&small_write, (uv_stream_t*) &client, &buf, 1, write_cb); in connect_cb() 74 write_queue_size0 = uv_stream_get_write_queue_size((uv_stream_t*) &client); in connect_cb() 79 r = uv_write(&big_write, (uv_stream_t*) &client, &buf, 1, write_cb); in connect_cb() 82 write_queue_size1 = uv_stream_get_write_queue_size((uv_stream_t*) &client); in connect_cb() 127 ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); in TEST_IMPL() 129 &client, in TEST_IMPL()
|
H A D | test-pipe-connect-error.c | 62 uv_pipe_t client; in TEST_IMPL() local 66 r = uv_pipe_init(uv_default_loop(), &client, 0); in TEST_IMPL() 68 uv_pipe_connect(&req, &client, BAD_PIPENAME, connect_cb); in TEST_IMPL() 82 uv_pipe_t client; in TEST_IMPL() local 86 r = uv_pipe_init(uv_default_loop(), &client, 0); in TEST_IMPL() 88 uv_pipe_connect(&req, &client, path, connect_cb_file); in TEST_IMPL()
|
H A D | test-udp-try-send.c | 30 ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) 33 static uv_udp_t client; variable 75 uv_close((uv_handle_t*) &client, close_cb); in sv_recv_cb() 100 r = uv_udp_init(uv_default_loop(), &client); in TEST_IMPL() 104 r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &addr); in TEST_IMPL() 108 r = uv_udp_try_send(&client, &buf, 1, (const struct sockaddr*) &addr); in TEST_IMPL() 116 ASSERT_OK(client.send_queue_size); in TEST_IMPL()
|
H A D | test-tcp-try-write-error.c | 30 static uv_tcp_t client; variable 49 r = uv_try_write((uv_stream_t*) &client, &buf, 1); in incoming_close_cb() 52 ASSERT_OK(client.write_queue_size); in incoming_close_cb() 93 ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); in TEST_IMPL() 95 &client, in TEST_IMPL() 100 uv_close((uv_handle_t*) &client, close_cb); in TEST_IMPL()
|
H A D | test-tcp-try-write.c | 32 static uv_tcp_t client; variable 54 r = uv_try_write((uv_stream_t*) &client, &buf, 1); in connect_cb() 64 r = uv_try_write((uv_stream_t*) &client, &buf, 1); in connect_cb() 66 uv_close((uv_handle_t*) &client, close_cb); in connect_cb() 119 ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); in TEST_IMPL() 121 &client, in TEST_IMPL()
|
H A D | test-udp-send-unreachable.c | 30 ASSERT_NE((uv_udp_t*)(handle) == &client || (uv_udp_t*)(handle) == &client2, 0) 32 static uv_udp_t client; variable 99 uv_close((uv_handle_t*) &client, close_cb); in timer_cb() 128 r = uv_udp_init(uv_default_loop(), &client); in TEST_IMPL() 131 r = uv_udp_bind(&client, (const struct sockaddr*) &addr2, 0); in TEST_IMPL() 134 r = uv_udp_recv_start(&client, alloc_cb, recv_cb); in TEST_IMPL() 141 &client, in TEST_IMPL() 151 &client, in TEST_IMPL()
|
H A D | test-udp-send-immediate.c | 30 ASSERT_NE((uv_udp_t*)(handle) == &server || (uv_udp_t*)(handle) == &client, 0) 33 static uv_udp_t client; variable 92 uv_close((uv_handle_t*) &client, close_cb); in sv_recv_cb() 116 r = uv_udp_init(uv_default_loop(), &client); in TEST_IMPL() 123 &client, in TEST_IMPL() 133 &client, in TEST_IMPL()
|
H A D | test-udp-send-hang-loop.c | 32 static uv_udp_t client; variable 53 uv_close((uv_handle_t*) &client, NULL); in idle_cb() 59 &client, in idle_cb() 71 CHECK_OBJECT(req->handle, uv_udp_t, client); in send_cb() 87 ASSERT_OK(uv_udp_init(uv_default_loop(), &client)); in TEST_IMPL()
|
H A D | test-tcp-close-after-read-timeout.c | 25 static uv_tcp_t client; variable 50 r = uv_read_start((uv_stream_t*) &client, on_client_alloc, on_client_read); in on_client_connect() 77 uv_read_stop((uv_stream_t*) &client); in on_client_timeout() 78 uv_close((uv_handle_t*) &client, on_close); in on_client_timeout() 115 ASSERT_NE(handle == (uv_handle_t*) &client || in on_close() 157 r = uv_tcp_init(loop, &client); in TEST_IMPL() 161 &client, in TEST_IMPL()
|
H A D | test-udp-recv-in-a-row.c | 30 static uv_udp_t client; variable 80 uv_close((uv_handle_t*) &client, NULL); in check_cb() 98 ASSERT_OK(uv_udp_init(uv_default_loop(), &client)); in TEST_IMPL() 103 r = uv_udp_try_send(&client, in TEST_IMPL() 112 r = uv_udp_try_send(&client, in TEST_IMPL()
|
H A D | test-tcp-write-queue-order.c | 33 static uv_tcp_t client; variable 50 uv_close((uv_handle_t*) &client, close_cb); in timer_cb() 119 ASSERT_OK(uv_tcp_init(uv_default_loop(), &client)); in TEST_IMPL() 121 &client, in TEST_IMPL() 124 ASSERT_OK(uv_send_buffer_size((uv_handle_t*) &client, &buffer_size)); in TEST_IMPL()
|
H A D | test-multiple-listen.c | 31 static uv_tcp_t client; variable 71 uv_close((uv_handle_t*)&client, close_cb); in connect_cb() 84 r = uv_tcp_init(uv_default_loop(), &client); in client_connect() 88 &client, in client_connect()
|
H A D | test-delayed-accept.c | 154 uv_tcp_t* client = (uv_tcp_t*)malloc(sizeof *client); in client_connect() local 159 ASSERT_NOT_NULL(client); in client_connect() 162 r = uv_tcp_init(uv_default_loop(), client); in client_connect() 166 client, in client_connect()
|
/libuv/docs/code/multi-echo-server/ |
H A D | worker.c | 34 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read() argument 38 uv_write((uv_write_t*) req, client, &req->buf, 1, echo_write); in echo_read() 45 uv_close((uv_handle_t*) client, NULL); in echo_read() 68 uv_tcp_t *client = (uv_tcp_t*) malloc(sizeof(uv_tcp_t)); in on_new_connection() local 69 uv_tcp_init(loop, client); in on_new_connection() 70 if (uv_accept(q, (uv_stream_t*) client) == 0) { in on_new_connection() 72 uv_fileno((const uv_handle_t*) client, &fd); in on_new_connection() 74 uv_read_start((uv_stream_t*) client, alloc_buffer, echo_read); in on_new_connection() 77 uv_close((uv_handle_t*) client, NULL); in on_new_connection()
|
H A D | main.c | 37 uv_tcp_t *client = (uv_tcp_t*) malloc(sizeof(uv_tcp_t)); in on_new_connection() local 38 uv_tcp_init(loop, client); in on_new_connection() 39 if (uv_accept(server, (uv_stream_t*) client) == 0) { in on_new_connection() 43 … uv_write2(write_req, (uv_stream_t*) &worker->pipe, &dummy_buf, 1, (uv_stream_t*) client, NULL); in on_new_connection() 47 uv_close((uv_handle_t*) client, NULL); in on_new_connection()
|
/libuv/docs/code/cgi/ |
H A D | main.c | 17 void invoke_cgi_script(uv_tcp_t *client) { in invoke_cgi_script() argument 33 child_stdio[1].data.stream = (uv_stream_t*) client; in invoke_cgi_script() 42 child_req.data = (void*) client; in invoke_cgi_script() 56 uv_tcp_t *client = (uv_tcp_t*) malloc(sizeof(uv_tcp_t)); in on_new_connection() local 57 uv_tcp_init(loop, client); in on_new_connection() 58 if (uv_accept(server, (uv_stream_t*) client) == 0) { in on_new_connection() 59 invoke_cgi_script(client); in on_new_connection() 62 uv_close((uv_handle_t*) client, NULL); in on_new_connection()
|
/libuv/docs/code/pipe-echo-server/ |
H A D | main.c | 37 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read() argument 41 uv_write((uv_write_t*) req, client, &req->buf, 1, echo_write); in echo_read() 48 uv_close((uv_handle_t*) client, NULL); in echo_read() 60 uv_pipe_t *client = (uv_pipe_t*) malloc(sizeof(uv_pipe_t)); in on_new_connection() local 61 uv_pipe_init(loop, client, 0); in on_new_connection() 62 if (uv_accept(server, (uv_stream_t*) client) == 0) { in on_new_connection() 63 uv_read_start((uv_stream_t*) client, alloc_buffer, echo_read); in on_new_connection() 66 uv_close((uv_handle_t*) client, NULL); in on_new_connection()
|
/libuv/docs/code/tcp-echo-server/ |
H A D | main.c | 39 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read() argument 43 uv_write((uv_write_t*) req, client, &req->buf, 1, echo_write); in echo_read() 49 uv_close((uv_handle_t*) client, on_close); in echo_read() 62 uv_tcp_t *client = (uv_tcp_t*) malloc(sizeof(uv_tcp_t)); in on_new_connection() local 63 uv_tcp_init(loop, client); in on_new_connection() 64 if (uv_accept(server, (uv_stream_t*) client) == 0) { in on_new_connection() 65 uv_read_start((uv_stream_t*) client, alloc_buffer, echo_read); in on_new_connection() 68 uv_close((uv_handle_t*) client, on_close); in on_new_connection()
|