Home
last modified time | relevance | path

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

12345

/libuv/test/
H A Dtest-ipc.c79 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()
253 r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); 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()
311 stdio[0].data.stream = (uv_stream_t*) channel; in spawn_helper()
658 r = uv_accept(server, (uv_stream_t*)conn); in ipc_on_connection_tcp_conn()
664 (uv_stream_t*)conn, NULL); in ipc_on_connection_tcp_conn()
667 r = uv_read_start((uv_stream_t*) conn, in ipc_on_connection_tcp_conn()
709 (uv_stream_t*)&tcp_server, NULL); in ipc_helper()
[all …]
H A 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()
189 ASSERT(uv_is_readable((uv_stream_t*) &tty_in)); in TEST_IMPL()
190 ASSERT(!uv_is_writable((uv_stream_t*) &tty_in)); in TEST_IMPL()
336 r = uv_read_stop((uv_stream_t*) &tty_in); in TEST_IMPL()
382 ASSERT(uv_is_readable((uv_stream_t*) &tty)); in TEST_IMPL()
383 ASSERT(uv_is_writable((uv_stream_t*) &tty)); in TEST_IMPL()
385 ASSERT(!uv_is_readable((uv_stream_t*) &tty)); in TEST_IMPL()
[all …]
H A Dtest-tcp-write-in-a-row.c48 ASSERT_OK(uv_stream_get_write_queue_size((uv_stream_t*) &client)); 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()
93 static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) {} in read_cb()
95 static void connection_cb(uv_stream_t* tcp, int status) { in connection_cb()
100 ASSERT_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
101 ASSERT_OK(uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); in connection_cb()
111 ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); in start_server()
H A 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_OK(uv_accept(server, (uv_stream_t* )&connection)); in on_connection()
95 ASSERT_OK(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_OK(uv_listen((uv_stream_t*)&server, 10, on_connection)); in TEST_IMPL()
H A 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_PTR_EQ(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()
H A 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_OK(uv_accept(server, (uv_stream_t*) &connection)); 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()
H A 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_PTR_EQ(req->handle, (uv_stream_t*) &client_handle); in connect_cb()
69 ASSERT_PTR_EQ(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_OK(uv_accept(handle, (uv_stream_t*) &peer_handle)); in connection_cb()
81 ASSERT_OK(uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); in connection_cb()
82 ASSERT_OK(uv_write(&write_req, (uv_stream_t*) &peer_handle, in connection_cb()
102 ASSERT_OK(uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); in TEST_IMPL()
H A 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_PTR_EQ(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()
H A 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_PTR_EQ(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_OK(uv_accept(handle, (uv_stream_t*) &peer_handle)); in connection_cb()
89 ASSERT_OK(uv_read_start((uv_stream_t*) &peer_handle, alloc_cb, read_cb)); in connection_cb()
94 ASSERT_OK(uv_stream_set_blocking((uv_stream_t*) &client_handle, 1)); in connection_cb()
109 ASSERT_OK(uv_stream_set_blocking((uv_stream_t*) &client_handle, 0)); in connection_cb()
125 ASSERT_OK(uv_listen((uv_stream_t*) &server_handle, 1, connection_cb)); in TEST_IMPL()
H A 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_OK(uv_accept(tcp, (uv_stream_t*) &incoming)); in connection_cb()
96 ASSERT_OK(uv_read_start((uv_stream_t*) &incoming, alloc_cb, read_cb)); in connection_cb()
107 ASSERT_OK(uv_listen((uv_stream_t*) &server, 128, connection_cb)); in start_server()
H A 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,
128 (uv_stream_t*) &pc->peer_handle, in ipc_connection_cb()
131 (uv_stream_t*) &sc->server_handle, in ipc_connection_cb()
157 ASSERT_OK(uv_read_start((uv_stream_t*) &ctx->ipc_pipe, in ipc_connect_cb()
173 static void ipc_read_cb(uv_stream_t* handle, in ipc_read_cb()
269 get_listen_handle(&loop, (uv_stream_t*) &ctx->server_handle); in server_cb()
273 ASSERT_OK(uv_listen((uv_stream_t*) &ctx->server_handle, in server_cb()
307 ASSERT_OK(uv_accept(server_handle, (uv_stream_t*) storage)); in sv_connection_cb()
[all …]
H A 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_OK(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_PTR_EQ(server, (uv_stream_t*) &tcp_server); in connection_cb()
130 ASSERT_OK(uv_accept(server, (uv_stream_t*) incoming)); in connection_cb()
138 ASSERT_OK(uv_read_start((uv_stream_t*) incoming, alloc_cb, read_cb)); in connection_cb()
169 ASSERT_OK(uv_listen((uv_stream_t*) &tcp_server, in TEST_IMPL()
H A 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_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()
H A Dtest-tcp-close-reset.c64 r = uv_write(&write_reqs[i], (uv_stream_t*) handle, &buf, 1, write_cb); in do_write()
76 (uv_stream_t*) handle, in do_close()
92 ASSERT_EQ(UV_ENOTCONN, uv_shutdown(&shutdown_req, (uv_stream_t*) handle, in do_close()
114 uv_read_start((uv_stream_t*) &tcp_client, alloc_cb, read_cb2); in connect_cb()
124 ASSERT_PTR_EQ(req->handle, (uv_stream_t*)&tcp_client); in write_cb()
140 ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &tcp_client); in shutdown_cb()
142 ASSERT_PTR_EQ(req->handle, (uv_stream_t*) &tcp_accepted); in shutdown_cb()
160 static void connection_cb(uv_stream_t* server, int status) { in connection_cb()
164 ASSERT_OK(uv_accept(server, (uv_stream_t*) &tcp_accepted)); in connection_cb()
166 uv_read_start((uv_stream_t*) &tcp_accepted, alloc_cb, read_cb); in connection_cb()
[all …]
H A Dtest-ipc-send-recv.c37 uv_stream_t stream;
88 static void recv_cb(uv_stream_t* handle, in recv_cb()
151 (uv_stream_t*)&ctx.channel, in connect_cb()
162 (uv_stream_t*)&ctx.channel, in connect_cb()
301 static void read_cb(uv_stream_t* handle, in read_cb()
347 (uv_stream_t*)&ctx2.channel, in read_cb()
358 ASSERT_EQ(1, uv_is_readable((uv_stream_t*)&ctx2.channel)); in send_recv_start()
359 ASSERT_EQ(1, uv_is_writable((uv_stream_t*)&ctx2.channel)); in send_recv_start()
366 static void listen_cb(uv_stream_t* handle, int status) { in listen_cb()
368 ASSERT_PTR_EQ(handle, (uv_stream_t*)&ctx2.listen); in listen_cb()
[all …]
H A Dbenchmark-pump.c38 static void do_write(uv_stream_t*);
51 static uv_stream_t* server;
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()
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()
289 stream = (uv_stream_t*)malloc(sizeof(uv_pipe_t)); in connection_cb()
385 server = (uv_stream_t*)&tcpServer; in HELPER_IMPL()
[all …]
H A 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_OK(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()
/libuv/src/win/
H A Dstream.c51 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()
232 int uv_is_readable(const uv_stream_t* handle) { in uv_is_readable()
[all …]
/libuv/docs/src/
H A Dstream.rst4 :c:type:`uv_stream_t` --- Stream handle
15 .. c:type:: uv_stream_t
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
121 .. c:function:: int uv_accept(uv_stream_t* server, uv_stream_t* client)
147 .. c:function:: int uv_read_stop(uv_stream_t*)
190 …ction:: int uv_write2(uv_write_t* req, uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nb…
[all …]
/libuv/src/unix/
H A Dstream.c47 uv_stream_t* stream;
75 static void uv__read(uv_stream_t* stream);
83 uv_stream_t* stream, in uv__stream_init()
147 uv_stream_t* stream; in uv__stream_osx_select()
236 uv_stream_t* stream; in uv__stream_osx_select_cb()
509 uv_stream_t* stream; in uv__server_io()
536 int uv_accept(uv_stream_t* server, uv_stream_t* client) { in uv_accept()
715 uv_stream_t* stream = req->handle; in uv__write_req_finish()
1190 uv_stream_t* stream; in uv__stream_io()
1334 uv_stream_t* stream, in uv_write2()
[all …]
/libuv/docs/code/uvtee/
H A 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()
/libuv/docs/code/multi-echo-server/
H A 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()
H A Dworker.c34 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read()
51 void on_new_connection(uv_stream_t *q, ssize_t nread, const uv_buf_t *buf) { in on_new_connection()
70 if (uv_accept(q, (uv_stream_t*) client) == 0) { in on_new_connection()
74 uv_read_start((uv_stream_t*) client, alloc_buffer, echo_read); in on_new_connection()
86 uv_read_start((uv_stream_t*)&queue, alloc_buffer, on_new_connection); in main()
/libuv/docs/code/pipe-echo-server/
H A Dmain.c37 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read()
54 void on_new_connection(uv_stream_t *server, int status) { 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()
89 if ((r = uv_listen((uv_stream_t*) &server, 128, on_new_connection))) { in main()
/libuv/docs/code/tcp-echo-server/
H A Dmain.c39 void echo_read(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { in echo_read()
55 void on_new_connection(uv_stream_t *server, int status) { 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()
81 int r = uv_listen((uv_stream_t*) &server, DEFAULT_BACKLOG, on_new_connection); in main()

Completed in 53 milliseconds

12345