Home
last modified time | relevance | path

Searched refs:tcp (Results 1 – 25 of 39) sorted by relevance

12

/libuv/test/
H A Dtest-shutdown-eof.c28 static uv_tcp_t tcp; variable
49 ASSERT_PTR_EQ((uv_tcp_t*)t, &tcp); in read_cb()
92 ASSERT_OK(uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); in connect_cb()
97 ASSERT_EQ(UV_EINVAL, uv_read_start((uv_stream_t*)&tcp, NULL, read_cb)); in connect_cb()
98 ASSERT_EQ(UV_EINVAL, uv_read_start((uv_stream_t*)&tcp, alloc_cb, NULL)); in connect_cb()
104 uv_write(&write_req, (uv_stream_t*) &tcp, &qbuf, 1, NULL); in connect_cb()
107 uv_shutdown(&shutdown_req, (uv_stream_t*) &tcp, shutdown_cb); in connect_cb()
115 ASSERT_PTR_EQ(handle, (uv_handle_t*) &tcp); in tcp_close_cb()
141 uv_close((uv_handle_t*) &tcp, tcp_close_cb); in timer_cb()
166 r = uv_tcp_init(uv_default_loop(), &tcp); in TEST_IMPL()
[all …]
H A Dtest-shutdown-simultaneous.c27 static uv_tcp_t tcp; variable
53 ASSERT_PTR_EQ((uv_tcp_t*)t, &tcp); in read_cb()
68 uv_shutdown(&shutdown_req, (uv_stream_t*) &tcp, shutdown_cb); in read_cb()
86 ASSERT_OK(uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); in connect_cb()
89 ASSERT_EQ(UV_EALREADY, uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); in connect_cb()
91 ASSERT_EQ(UV_EINVAL, uv_read_start((uv_stream_t*)&tcp, NULL, read_cb)); in connect_cb()
92 ASSERT_EQ(UV_EINVAL, uv_read_start((uv_stream_t*)&tcp, alloc_cb, NULL)); in connect_cb()
98 ASSERT_EQ(qbuf.len, uv_try_write((uv_stream_t*) &tcp, &qbuf, 1)); in connect_cb()
117 r = uv_tcp_init(uv_default_loop(), &tcp); in TEST_IMPL()
121 &tcp, in TEST_IMPL()
H A Dbenchmark-ping-pongs.c35 uv_tcp_t tcp; member
56 static void buf_alloc(uv_handle_t* tcp, size_t size, uv_buf_t* buf) { in buf_alloc() argument
106 if (uv_write(req, (uv_stream_t*) &pinger->tcp, &buf, 1, pinger_write_cb)) { in pinger_write_ping()
124 static void pinger_read_cb(uv_stream_t* tcp, in pinger_read_cb() argument
130 pinger = (pinger_t*)tcp->data; in pinger_read_cb()
140 uv_close((uv_handle_t*)tcp, pinger_close_cb); in pinger_read_cb()
153 (uv_stream_t*) tcp, in pinger_read_cb()
192 r = uv_tcp_init(loop, &pinger->tcp); in pinger_new()
195 pinger->tcp.data = pinger; in pinger_new()
197 ASSERT_OK(uv_tcp_bind(&pinger->tcp, in pinger_new()
[all …]
H A Dtest-tcp-rst.c25 static uv_tcp_t tcp; variable
34 ASSERT_PTR_EQ(handle, (uv_handle_t*) &tcp); in close_cb()
47 ASSERT_PTR_EQ((uv_tcp_t*) t, &tcp); in read_cb()
65 ASSERT_OK(uv_read_start((uv_stream_t*) &tcp, alloc_cb, read_cb)); in connect_cb()
68 ASSERT_EQ(qbuf.len, uv_try_write((uv_stream_t*) &tcp, &qbuf, 1)); in connect_cb()
90 r = uv_tcp_init(uv_default_loop(), &tcp); in TEST_IMPL()
94 &tcp, in TEST_IMPL()
H A Dtest-socket-buffer-size.c30 static uv_tcp_t tcp; variable
61 ASSERT_OK(uv_tcp_init(uv_default_loop(), &tcp)); in TEST_IMPL()
62 ASSERT_OK(uv_tcp_bind(&tcp, (struct sockaddr*) &addr, 0)); in TEST_IMPL()
63 check_buffer_size((uv_handle_t*) &tcp); in TEST_IMPL()
64 uv_close((uv_handle_t*) &tcp, close_cb); in TEST_IMPL()
H A Dtest-connection-fail.c29 static uv_tcp_t tcp; variable
61 uv_close((uv_handle_t*)&tcp, on_close); in timer_cb()
69 ASSERT_PTR_EQ((uv_stream_t*) &tcp, req->handle); in on_connect_with_close()
98 r = uv_tcp_init(uv_default_loop(), &tcp); in connection_fail()
103 ASSERT_OK(uv_tcp_bind(&tcp, (const struct sockaddr*) &client_addr, 0)); in connection_fail()
106 &tcp, in connection_fail()
H A Dtest-handle-fileno.c51 uv_tcp_t tcp; in TEST_IMPL() local
67 r = uv_tcp_init(loop, &tcp); in TEST_IMPL()
69 r = uv_fileno((uv_handle_t*) &tcp, &fd); in TEST_IMPL()
71 r = uv_tcp_bind(&tcp, (const struct sockaddr*) &addr, 0); in TEST_IMPL()
73 r = uv_fileno((uv_handle_t*) &tcp, &fd); in TEST_IMPL()
75 uv_close((uv_handle_t*) &tcp, NULL); in TEST_IMPL()
76 r = uv_fileno((uv_handle_t*) &tcp, &fd); in TEST_IMPL()
H A Dtest-ping-pong.c47 uv_tcp_t tcp; member
74 if (handle == (uv_handle_t*) &pinger->stream.tcp) { in pinger_on_close()
98 stream = (uv_stream_t*) &pinger->stream.tcp; in pinger_write_ping()
230 r = uv_tcp_init(uv_default_loop(), &pinger->stream.tcp); in tcp_pinger_v6_new()
231 pinger->stream.tcp.data = pinger; in tcp_pinger_v6_new()
237 &pinger->stream.tcp, in tcp_pinger_v6_new()
261 r = uv_tcp_init(uv_default_loop(), &pinger->stream.tcp); in tcp_pinger_new()
262 pinger->stream.tcp.data = pinger; in tcp_pinger_new()
268 &pinger->stream.tcp, in tcp_pinger_new()
327 ASSERT_OK(uv_tcp_open(&pinger->stream.tcp, fds[1])); in socketpair_pinger_new()
[all …]
H A Dtest-tcp-writealot.c66 uv_tcp_t* tcp; in shutdown_cb() local
71 tcp = (uv_tcp_t*)(req->handle); in shutdown_cb()
74 ASSERT_OK(tcp->write_queue_size); in shutdown_cb()
84 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read_cb() argument
85 ASSERT_NOT_NULL(tcp); in read_cb()
93 uv_close((uv_handle_t*)tcp, close_cb); in read_cb()
H A Dtest-tcp-try-write.c78 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read_cb() argument
80 uv_close((uv_handle_t*) tcp, close_cb); in read_cb()
89 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb() argument
92 ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); in connection_cb()
93 ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
H A Dtest-tcp-try-write-error.c62 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb() argument
65 ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); in connection_cb()
66 ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
70 uv_close((uv_handle_t*) tcp, close_cb); in connection_cb()
H A Dtest-delayed-accept.c78 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb() argument
91 timer_handle->data = tcp; in connection_cb()
118 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read_cb() argument
128 ASSERT_NOT_NULL(tcp); in read_cb()
130 uv_close((uv_handle_t*)tcp, close_cb); in read_cb()
H A Dtest-tcp-write-in-a-row.c93 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) {} in read_cb() argument
95 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb() argument
99 ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); in connection_cb()
100 ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
H A Dtest-tcp-alloc-cb-fail.c77 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb() argument
80 ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); in connection_cb()
81 ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
H A Dtest-ipc-send-recv.c39 uv_tcp_t tcp; member
126 r = uv_tcp_init(ctx.channel.loop, &recv->tcp); in recv_cb()
252 r = uv_tcp_init(uv_default_loop(), &ctx.send.tcp); in run_ipc_send_recv_tcp()
255 r = uv_tcp_init(uv_default_loop(), &ctx.send2.tcp); in run_ipc_send_recv_tcp()
258 r = uv_tcp_bind(&ctx.send.tcp, (const struct sockaddr*) &addr, 0); in run_ipc_send_recv_tcp()
261 r = uv_tcp_bind(&ctx.send2.tcp, (const struct sockaddr*) &addr, 0); in run_ipc_send_recv_tcp()
337 r = uv_tcp_init(ctx2.channel.loop, &recv->tcp); in read_cb()
H A Dtest-getsockname.c38 static uv_tcp_t tcp; variable
166 uv_close((uv_handle_t*)&tcp, NULL); in on_connect()
219 r = uv_tcp_init(loop, &tcp); in tcp_connector()
220 tcp.data = &connect_req; in tcp_connector()
224 &tcp, in tcp_connector()
231 r = uv_tcp_getsockname(&tcp, &sockname, &namelen); in tcp_connector()
H A Dtest-tcp-write-queue-order.c86 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb() argument
89 ASSERT_OK(uv_tcp_init(tcp->loop, &incoming)); in connection_cb()
90 ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
H A Dtest-tcp-open.c113 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read_cb() argument
114 ASSERT_NOT_NULL(tcp); in read_cb()
122 uv_close((uv_handle_t*)tcp, close_cb); in read_cb()
127 static void read1_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read1_cb() argument
129 ASSERT_NOT_NULL(tcp); in read1_cb()
137 uv_close((uv_handle_t*)tcp, close_cb); in read1_cb()
H A Dtest-callback-stack.c70 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read_cb() argument
83 uv_close((uv_handle_t*)tcp, close_cb); in read_cb()
99 if (uv_shutdown(&shutdown_req, (uv_stream_t*)tcp, shutdown_cb)) { in read_cb()
H A Dtest-tcp-bind-error.c302 uv_tcp_t tcp; in TEST_IMPL() local
310 ASSERT_OK(uv_tcp_init(uv_default_loop(), &tcp)); in TEST_IMPL()
311 uv_close((uv_handle_t*) &tcp, NULL); in TEST_IMPL()
312 ASSERT_EQ(uv_tcp_bind(&tcp, (struct sockaddr*) &addr, 0), UV_EINVAL); in TEST_IMPL()
313 ASSERT_EQ(uv_listen((uv_stream_t*) &tcp, 5, NULL), UV_EINVAL); in TEST_IMPL()
H A Dbenchmark-pump.c246 uv_tcp_t* tcp; in maybe_connect_some() local
253 tcp = &tcp_write_handles[max_connect_socket++]; in maybe_connect_some()
255 r = uv_tcp_init(loop, tcp); in maybe_connect_some()
260 tcp, in maybe_connect_some()
/libuv/src/unix/
H A Dtcp.c132 err = new_socket(tcp, domain, 0); in uv_tcp_init_ex()
135 if (tcp->io_watcher.fd != -1) in uv_tcp_init_ex()
137 tcp->io_watcher.fd = -1; in uv_tcp_init_ex()
151 int uv__tcp_bind(uv_tcp_t* tcp, in uv__tcp_bind() argument
206 tcp->flags |= UV_HANDLE_BOUND; in uv__tcp_bind()
208 tcp->flags |= UV_HANDLE_IPV6; in uv__tcp_bind()
425 if (tcp->delayed_error) in uv__tcp_listen()
426 return tcp->delayed_error; in uv__tcp_listen()
443 tcp->connection_cb = cb; in uv__tcp_listen()
444 tcp->flags |= UV_HANDLE_BOUND; in uv__tcp_listen()
[all …]
/libuv/src/win/
H A Dtcp.c599 handle->tcp.serv.accept_reqs = in uv__tcp_listen()
1301 tcp->loop, tcp, socket, xfer_info->socket_info.iAddressFamily, 1); in uv__tcp_xfer_import()
1397 socket = tcp->socket; in uv__tcp_try_cancel_reqs()
1434 if (socket != tcp->socket) { in uv__tcp_try_cancel_reqs()
1448 uv__tcp_try_cancel_reqs(tcp); in uv__tcp_close()
1450 if (tcp->tcp.serv.accept_reqs != NULL) { in uv__tcp_close()
1455 uv_tcp_accept_t* req = &tcp->tcp.serv.accept_reqs[i]; in uv__tcp_close()
1471 uv__handle_closing(tcp); in uv__tcp_close()
1480 closesocket(tcp->socket); in uv__tcp_close()
1481 tcp->socket = INVALID_SOCKET; in uv__tcp_close()
[all …]
/libuv/
H A DMakefile.am85 src/win/tcp.c \
114 src/unix/tcp.c \
269 test/test-tcp-close.c \
276 test/test-tcp-flags.c \
277 test/test-tcp-open.c \
278 test/test-tcp-read-stop.c \
279 test/test-tcp-reuseport.c \
281 test/test-tcp-rst.c \
284 test/test-tcp-oob.c \
287 test/test-tcp-writealot.c \
[all …]
H A DCMakeLists.txt220 src/win/tcp.c
251 src/unix/tcp.c
642 test/test-tcp-close.c
649 test/test-tcp-flags.c
650 test/test-tcp-oob.c
651 test/test-tcp-open.c
652 test/test-tcp-read-stop.c
653 test/test-tcp-reuseport.c
655 test/test-tcp-rst.c
657 test/test-tcp-try-write.c
[all …]

Completed in 55 milliseconds

12