Home
last modified time | relevance | path

Searched refs:uv_stream_t (Results 1 – 25 of 149) sorted by relevance

123456

/third_party/libuv/test/
Dtest-ipc.c65 static void on_connection(uv_stream_t* server, int status) { in on_connection()
79 r = uv_accept(server, (uv_stream_t*)conn); in on_connection()
143 static void on_read(uv_stream_t* handle, in on_read()
184 r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); in on_read()
187 r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); in on_read()
196 r = uv_write(&write_req, (uv_stream_t*)pipe, &outbuf, 1, NULL); in on_read()
213 static void on_read_listen_after_bound_twice(uv_stream_t* handle, in on_read_listen_after_bound_twice()
253 r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); in on_read_listen_after_bound_twice()
256 r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); in on_read_listen_after_bound_twice()
264 r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server2); in on_read_listen_after_bound_twice()
[all …]
Dtest-tty.c99 ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); in TEST_IMPL()
100 ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); in TEST_IMPL()
104 ASSERT(!uv_is_readable((uv_stream_t*) &tty_out)); in TEST_IMPL()
105 ASSERT(uv_is_writable((uv_stream_t*) &tty_out)); in TEST_IMPL()
159 static void tty_raw_read(uv_stream_t* tty_in, ssize_t nread, const uv_buf_t* buf) { in tty_raw_read()
193 ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); in TEST_IMPL()
194 ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); in TEST_IMPL()
196 r = uv_read_start((uv_stream_t*)&tty_in, tty_raw_alloc, tty_raw_read); in TEST_IMPL()
251 ASSERT(!uv_is_readable((uv_stream_t*) &tty_out)); in TEST_IMPL()
252 ASSERT(uv_is_writable((uv_stream_t*) &tty_out)); in TEST_IMPL()
[all …]
Dtest-tcp-read-stop-start.c33 static void on_read2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
48 static void do_write(uv_stream_t* stream, uv_write_cb cb) { in do_write()
64 static void on_read1(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in on_read1()
79 static void on_read2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in on_read2()
88 static void on_connection(uv_stream_t* server, int status) { in on_connection()
93 ASSERT(0 == uv_accept(server, (uv_stream_t* )&connection)); in on_connection()
95 ASSERT(0 == uv_read_start((uv_stream_t*)&connection, on_alloc, on_read1)); in on_connection()
101 do_write((uv_stream_t*)&client, on_write_close_immediately); in on_connect()
116 ASSERT(0 == uv_listen((uv_stream_t*)&server, 10, on_connection)); in TEST_IMPL()
Dtest-tcp-close-after-read-timeout.c33 static void on_connection(uv_stream_t* server, int status);
39 static void on_client_read(uv_stream_t* stream,
50 r = uv_read_start((uv_stream_t*) &client, on_client_alloc, on_client_read); in on_client_connect()
67 static void on_client_read(uv_stream_t* stream, ssize_t nread, in on_client_read()
77 uv_read_stop((uv_stream_t*) &client); in on_client_timeout()
92 static void on_connection_read(uv_stream_t* stream, in on_connection_read()
101 static void on_connection(uv_stream_t* server, int status) { in on_connection()
105 ASSERT_EQ(uv_accept(server, (uv_stream_t*) &connection), 0); in on_connection()
107 r = uv_read_start((uv_stream_t*) &connection, in on_connection()
134 r = uv_listen((uv_stream_t*) handle, 128, on_connection); in start_server()
Dbenchmark-multi-accept.c61 uv_stream_t* server_handle;
82 static void ipc_connection_cb(uv_stream_t* ipc_pipe, int status);
86 static void ipc_read_cb(uv_stream_t* handle,
94 static void sv_connection_cb(uv_stream_t* server_handle, int status);
95 static void sv_read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf);
107 static void ipc_connection_cb(uv_stream_t* ipc_pipe, int status) { in ipc_connection_cb()
126 ASSERT(0 == uv_accept(ipc_pipe, (uv_stream_t*) &pc->peer_handle)); in ipc_connection_cb()
128 (uv_stream_t*) &pc->peer_handle, in ipc_connection_cb()
131 (uv_stream_t*) &sc->server_handle, in ipc_connection_cb()
157 ASSERT(0 == uv_read_start((uv_stream_t*) &ctx->ipc_pipe, in ipc_connect_cb()
[all …]
Dtest-tcp-write-to-half-open-connection.c29 static void connection_cb(uv_stream_t* server, int status);
32 static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
44 static void connection_cb(uv_stream_t* server, int status) { in connection_cb()
48 ASSERT(server == (uv_stream_t*)&tcp_server); in connection_cb()
54 r = uv_accept(server, (uv_stream_t*)&tcp_peer); in connection_cb()
57 r = uv_read_start((uv_stream_t*)&tcp_peer, alloc_cb, read_cb); in connection_cb()
63 r = uv_write(&write_req, (uv_stream_t*)&tcp_peer, &buf, 1, write_cb); in connection_cb()
77 static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in read_cb()
121 r = uv_listen((uv_stream_t*)&tcp_server, 1, connection_cb); in TEST_IMPL()
Dtest-tcp-close-reset.c64 r = uv_write(&write_reqs[i], (uv_stream_t*) handle, &buf, 1, write_cb); in do_write()
75 ASSERT(0 == uv_shutdown(&shutdown_req, (uv_stream_t*) handle, shutdown_cb)); in do_close()
89 ASSERT(UV_ENOTCONN == uv_shutdown(&shutdown_req, (uv_stream_t*) handle, shutdown_cb)); in do_close()
101 static void read_cb2(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in read_cb2()
110 uv_read_start((uv_stream_t*) &tcp_client, alloc_cb, read_cb2); in connect_cb()
120 ASSERT(req->handle == (uv_stream_t*)&tcp_client); in write_cb()
136 ASSERT(req->handle == (uv_stream_t*) &tcp_client); in shutdown_cb()
138 ASSERT(req->handle == (uv_stream_t*) &tcp_accepted); in shutdown_cb()
144 static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in read_cb()
156 static void connection_cb(uv_stream_t* server, int status) { in connection_cb()
[all …]
Dblackhole-server.c35 static void connection_cb(uv_stream_t* stream, int status);
37 static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
42 static void connection_cb(uv_stream_t* stream, int status) { in connection_cb()
47 ASSERT(stream == (uv_stream_t*)&tcp_server); in connection_cb()
55 r = uv_accept(stream, (uv_stream_t*)&conn->handle); in connection_cb()
58 r = uv_read_start((uv_stream_t*)&conn->handle, alloc_cb, read_cb); in connection_cb()
72 static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in read_cb()
114 r = uv_listen((uv_stream_t*)&tcp_server, 128, connection_cb); in HELPER_IMPL()
Dtest-tcp-unexpected-read.c57 static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { in read_cb()
63 ASSERT(req->handle == (uv_stream_t*) &client_handle); in connect_cb()
69 ASSERT(req->handle == (uv_stream_t*) &peer_handle); in write_cb()
74 static void connection_cb(uv_stream_t* handle, int status) { in connection_cb()
80 ASSERT(0 == uv_accept(handle, (uv_stream_t*) &peer_handle)); in connection_cb()
81 ASSERT(0 == uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); in connection_cb()
82 ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &peer_handle, in connection_cb()
102 ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); in TEST_IMPL()
Dtest-tcp-oob.c58 static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) { in read_cb()
78 ASSERT(req->handle == (uv_stream_t*) &client_handle); in connect_cb()
83 static void connection_cb(uv_stream_t* handle, int status) { in connection_cb()
88 ASSERT(0 == uv_accept(handle, (uv_stream_t*) &peer_handle)); in connection_cb()
89 ASSERT(0 == uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); in connection_cb()
94 ASSERT(0 == uv_stream_set_blocking((uv_stream_t*) &client_handle, 1)); in connection_cb()
109 ASSERT(0 == uv_stream_set_blocking((uv_stream_t*) &client_handle, 0)); in connection_cb()
125 ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); in TEST_IMPL()
Dtest-ipc-send-recv.c37 uv_stream_t stream;
86 static void recv_cb(uv_stream_t* handle, in recv_cb()
147 (uv_stream_t*)&ctx.channel, in connect_cb()
158 (uv_stream_t*)&ctx.channel, in connect_cb()
164 r = uv_read_start((uv_stream_t*)&ctx.channel, alloc_cb, recv_cb); in connect_cb()
297 static void read_cb(uv_stream_t* handle, in read_cb()
341 (uv_stream_t*)&ctx2.channel, in read_cb()
352 ASSERT(1 == uv_is_readable((uv_stream_t*)&ctx2.channel)); in send_recv_start()
353 ASSERT(1 == uv_is_writable((uv_stream_t*)&ctx2.channel)); in send_recv_start()
356 r = uv_read_start((uv_stream_t*)&ctx2.channel, alloc_cb, read_cb); in send_recv_start()
[all …]
Dbenchmark-pump.c38 static void do_write(uv_stream_t*);
51 static uv_stream_t* server;
171 static void read_cb(uv_stream_t* stream, ssize_t bytes, const uv_buf_t* buf) { in read_cb()
198 do_write((uv_stream_t*) req->handle); in write_cb()
202 static void do_write(uv_stream_t* stream) { in do_write()
236 do_write((uv_stream_t*) &tcp_write_handles[i]); in connect_cb()
238 do_write((uv_stream_t*) &pipe_write_handles[i]); in connect_cb()
277 static void connection_cb(uv_stream_t* s, int status) { in connection_cb()
278 uv_stream_t* stream; in connection_cb()
285 stream = (uv_stream_t*)malloc(sizeof(uv_tcp_t)); in connection_cb()
[all …]
Dtest-tcp-close-accept.c57 uv_stream_t* outgoing; in connect_cb()
77 outgoing = (uv_stream_t*) &tcp_outgoing[i]; in connect_cb()
87 static void read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { in read_cb()
114 ASSERT(0 == uv_read_start((uv_stream_t*) &tcp_check, alloc_cb, read_cb)); in read_cb()
117 static void connection_cb(uv_stream_t* server, int status) { in connection_cb()
121 ASSERT(server == (uv_stream_t*) &tcp_server); in connection_cb()
130 ASSERT(0 == uv_accept(server, (uv_stream_t*) incoming)); in connection_cb()
138 ASSERT(0 == uv_read_start((uv_stream_t*) incoming, alloc_cb, read_cb)); in connection_cb()
169 ASSERT(0 == uv_listen((uv_stream_t*) &tcp_server, in TEST_IMPL()
Dtest-tcp-try-write.c54 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()
78 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in read_cb()
89 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb()
93 ASSERT(0 == uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
96 ASSERT(0 == uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); in connection_cb()
107 ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, connection_cb)); in start_server()
Dtest-shutdown-simultaneous.c52 static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { in read_cb()
68 uv_shutdown(&shutdown_req, (uv_stream_t*) &tcp, shutdown_cb); in read_cb()
86 ASSERT_EQ(0, 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()
Dtest-spawn.c129 static void on_read(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in on_read()
139 static void on_read_once(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { in on_read_once()
291 options.stdio[1].data.stream = (uv_stream_t*) &out; in TEST_IMPL()
297 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
595 options.stdio[0].data.stream = (uv_stream_t*) ∈ in TEST_IMPL()
597 options.stdio[1].data.stream = (uv_stream_t*) &out; in TEST_IMPL()
605 r = uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb); in TEST_IMPL()
608 r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read); in TEST_IMPL()
636 options.stdio[3].data.stream = (uv_stream_t*) &pipe; in TEST_IMPL()
642 r = uv_read_start((uv_stream_t*) &pipe, on_alloc, on_read); in TEST_IMPL()
[all …]
Dtest-shutdown-eof.c48 static void read_cb(uv_stream_t* t, ssize_t nread, const uv_buf_t* buf) { in read_cb()
92 ASSERT_EQ(0, uv_read_start((uv_stream_t*)&tcp, alloc_cb, read_cb)); in connect_cb()
95 ASSERT_EQ(UV_EALREADY, 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()
Dtest-tcp-bind-error.c96 r = uv_listen((uv_stream_t*)&server1, 128, NULL); in TEST_IMPL()
98 r = uv_listen((uv_stream_t*)&server2, 128, NULL); in TEST_IMPL()
254 r = uv_listen((uv_stream_t*)&server, 128, NULL); in TEST_IMPL()
275 r = uv_listen((uv_stream_t*)&server, 128, NULL); in TEST_IMPL()
278 ASSERT(0 == uv_is_writable((uv_stream_t*) &server)); in TEST_IMPL()
279 ASSERT(0 == uv_is_readable((uv_stream_t*) &server)); in TEST_IMPL()
282 r = uv_write(&write_req, (uv_stream_t*) &server, &buf, 1, NULL); in TEST_IMPL()
284 r = uv_shutdown(&shutdown_req, (uv_stream_t*) &server, NULL); in TEST_IMPL()
286 r = uv_read_start((uv_stream_t*) &server, in TEST_IMPL()
313 ASSERT_EQ(uv_listen((uv_stream_t*) &tcp, 5, NULL), UV_EINVAL); in TEST_IMPL()
/third_party/node/deps/uv/src/win/
Dstream.c30 int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb) { in uv_listen()
51 int uv_accept(uv_stream_t* server, uv_stream_t* client) { in uv_accept()
70 int uv__read_start(uv_stream_t* handle, in uv__read_start()
94 int uv_read_stop(uv_stream_t* handle) { in uv_read_stop()
115 uv_stream_t* handle, in uv_write()
147 uv_stream_t* handle, in uv_write2()
150 uv_stream_t* send_handle, in uv_write2()
171 int uv_try_write(uv_stream_t* stream, in uv_try_write()
193 int uv_try_write2(uv_stream_t* stream, in uv_try_write2()
196 uv_stream_t* send_handle) { in uv_try_write2()
[all …]
/third_party/libuv/src/win/
Dstream.c30 int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb) { in uv_listen()
51 int uv_accept(uv_stream_t* server, uv_stream_t* client) { in uv_accept()
70 int uv__read_start(uv_stream_t* handle, in uv__read_start()
94 int uv_read_stop(uv_stream_t* handle) { in uv_read_stop()
115 uv_stream_t* handle, in uv_write()
147 uv_stream_t* handle, in uv_write2()
150 uv_stream_t* send_handle, in uv_write2()
171 int uv_try_write(uv_stream_t* stream, in uv_try_write()
193 int uv_try_write2(uv_stream_t* stream, in uv_try_write2()
196 uv_stream_t* send_handle) { in uv_try_write2()
[all …]
/third_party/node/deps/uv/src/unix/
Dstream.c47 uv_stream_t* stream;
63 static void uv__stream_connect(uv_stream_t*);
64 static void uv__write(uv_stream_t* stream);
65 static void uv__read(uv_stream_t* stream);
67 static void uv__write_callbacks(uv_stream_t* stream);
69 static void uv__drain(uv_stream_t* stream);
73 uv_stream_t* stream, in uv__stream_init()
110 static void uv__stream_osx_interrupt_select(uv_stream_t* stream) { in uv__stream_osx_interrupt_select()
137 uv_stream_t* stream; in uv__stream_osx_select()
226 uv_stream_t* stream; in uv__stream_osx_select_cb()
[all …]
/third_party/libuv/src/unix/
Dstream.c47 uv_stream_t* stream;
63 static void uv__stream_connect(uv_stream_t*);
64 static void uv__write(uv_stream_t* stream);
65 static void uv__read(uv_stream_t* stream);
67 static void uv__write_callbacks(uv_stream_t* stream);
69 static void uv__drain(uv_stream_t* stream);
73 uv_stream_t* stream, in uv__stream_init()
110 static void uv__stream_osx_interrupt_select(uv_stream_t* stream) { in uv__stream_osx_interrupt_select()
137 uv_stream_t* stream; in uv__stream_osx_select()
226 uv_stream_t* stream; in uv__stream_osx_select_cb()
[all …]
/third_party/libuv/docs/src/
Dstream.rst4 :c:type:`uv_stream_t` --- Stream handle
8 :c:type:`uv_stream_t` is an abstract type, libuv provides 3 stream implementations
15 .. c:type:: uv_stream_t
35 .. c:type:: void (*uv_read_cb)(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
71 .. c:type:: void (*uv_connection_cb)(uv_stream_t* server, int status)
81 .. c:member:: size_t uv_stream_t.write_queue_size
85 .. c:member:: uv_stream_t* uv_connect_t.handle
89 .. c:member:: uv_stream_t* uv_shutdown_t.handle
93 .. c:member:: uv_stream_t* uv_write_t.handle
97 .. c:member:: uv_stream_t* uv_write_t.send_handle
[all …]
/third_party/libuv/docs/code/uvtee/
Dmain.c36 void write_data(uv_stream_t *dest, size_t size, uv_buf_t buf, uv_write_cb cb) { in write_data()
40 uv_write((uv_write_t*) req, (uv_stream_t*)dest, &req->buf, 1, cb); in write_data()
43 void read_stdin(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) { in read_stdin()
52 write_data((uv_stream_t *)&stdout_pipe, nread, *buf, on_stdout_write); in read_stdin()
53 write_data((uv_stream_t *)&file_pipe, nread, *buf, on_file_write); in read_stdin()
75 uv_read_start((uv_stream_t*)&stdin_pipe, alloc_buffer, read_stdin); in main()
/third_party/libuv/docs/code/multi-echo-server/
Dmain.c31 void on_new_connection(uv_stream_t *server, int status) { 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()
80 child_stdio[0].data.stream = (uv_stream_t*) &worker->pipe; in setup_workers()
109 if ((r = uv_listen((uv_stream_t*) &server, 128, on_new_connection))) { in main()

123456