Lines Matching refs:r
67 int r; in on_connection() local
76 r = uv_tcp_init(server->loop, conn); in on_connection()
77 ASSERT_OK(r); in on_connection()
79 r = uv_accept(server, (uv_stream_t*)conn); in on_connection()
80 ASSERT_OK(r); in on_connection()
122 int r, i; in make_many_connections() local
128 r = uv_tcp_init(uv_default_loop(), &conn->conn); in make_many_connections()
129 ASSERT_OK(r); in make_many_connections()
132 r = uv_tcp_connect(&conn->conn_req, in make_many_connections()
136 ASSERT_OK(r); in make_many_connections()
146 int r; in on_read() local
181 r = uv_tcp_init(uv_default_loop(), &tcp_server); in on_read()
182 ASSERT_OK(r); in on_read()
184 r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); in on_read()
185 ASSERT_OK(r); in on_read()
187 r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); in on_read()
188 ASSERT_OK(r); in on_read()
196 r = uv_write(&write_req, (uv_stream_t*)pipe, &outbuf, 1, NULL); in on_read()
197 ASSERT_OK(r); in on_read()
216 int r; in on_read_listen_after_bound_twice() local
250 r = uv_tcp_init(uv_default_loop(), &tcp_server); in on_read_listen_after_bound_twice()
251 ASSERT_OK(r); 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()
254 ASSERT_OK(r); 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()
257 ASSERT_OK(r); in on_read_listen_after_bound_twice()
261 r = uv_tcp_init(uv_default_loop(), &tcp_server2); in on_read_listen_after_bound_twice()
262 ASSERT_OK(r); 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()
265 ASSERT_OK(r); in on_read_listen_after_bound_twice()
267 r = uv_listen((uv_stream_t*)&tcp_server2, BACKLOG, on_connection); in on_read_listen_after_bound_twice()
268 ASSERT_EQ(r, UV_EADDRINUSE); in on_read_listen_after_bound_twice()
287 int r; in spawn_helper() local
290 r = uv_pipe_init(uv_default_loop(), channel, 1); in spawn_helper()
291 ASSERT_OK(r); in spawn_helper()
295 r = uv_exepath(exepath, &exepath_size); in spawn_helper()
296 ASSERT_OK(r); in spawn_helper()
317 r = uv_spawn(uv_default_loop(), process, &options); in spawn_helper()
318 ASSERT_OK(r); in spawn_helper()
353 int r; in on_read_connection() local
387 r = uv_tcp_init(uv_default_loop(), &tcp_connection); in on_read_connection()
388 ASSERT_OK(r); in on_read_connection()
390 r = uv_accept(handle, (uv_stream_t*)&tcp_connection); in on_read_connection()
391 ASSERT_OK(r); in on_read_connection()
398 r = uv_write(&write_req, (uv_stream_t*)&tcp_connection, &outbuf, 1, in on_read_connection()
400 ASSERT_OK(r); in on_read_connection()
402 r = uv_read_start((uv_stream_t*)&tcp_connection, on_read_alloc, on_tcp_read); in on_read_connection()
403 ASSERT_OK(r); in on_read_connection()
419 int r; in run_ipc_test() local
424 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in run_ipc_test()
425 ASSERT_OK(r); in run_ipc_test()
436 int r = run_ipc_test("ipc_helper_listen_before_write", on_read); in TEST_IMPL() local
441 return r; in TEST_IMPL()
449 int r = run_ipc_test("ipc_helper_listen_after_write", on_read); in TEST_IMPL() local
454 return r; in TEST_IMPL()
462 int r = run_ipc_test("ipc_helper_tcp_connection", on_read_connection); in TEST_IMPL() local
467 return r; in TEST_IMPL()
474 int r; in TEST_IMPL() local
479 r = uv_tcp_init(uv_default_loop(), &server); in TEST_IMPL()
480 ASSERT_OK(r); in TEST_IMPL()
482 r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); in TEST_IMPL()
483 ASSERT_OK(r); in TEST_IMPL()
485 r = uv_tcp_simultaneous_accepts(&server, 1); in TEST_IMPL()
486 ASSERT_OK(r); in TEST_IMPL()
488 r = uv_listen((uv_stream_t*)&server, SOMAXCONN, NULL); in TEST_IMPL()
489 ASSERT_OK(r); in TEST_IMPL()
499 int r; in TEST_IMPL() local
504 r = uv_tcp_init(uv_default_loop(), &server); in TEST_IMPL()
505 ASSERT_OK(r); in TEST_IMPL()
507 r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0); in TEST_IMPL()
508 ASSERT_OK(r); in TEST_IMPL()
510 r = uv_tcp_simultaneous_accepts(&server, 0); in TEST_IMPL()
511 ASSERT_OK(r); in TEST_IMPL()
513 r = uv_listen((uv_stream_t*)&server, SOMAXCONN, NULL); in TEST_IMPL()
514 ASSERT_OK(r); in TEST_IMPL()
525 int r = run_ipc_test("ipc_helper_bind_twice", on_read_listen_after_bound_twice); in TEST_IMPL() local
528 return r; in TEST_IMPL()
533 int r; in TEST_IMPL() local
534 r = run_ipc_test("ipc_helper_send_zero", on_read_send_zero); in TEST_IMPL()
535 ASSERT_OK(r); in TEST_IMPL()
574 int r; in on_tcp_child_process_read() local
593 r = uv_write(&conn.tcp_write_req, tcp, &outbuf, 1, tcp_connection_write_cb); in on_tcp_child_process_read()
594 ASSERT_OK(r); in on_tcp_child_process_read()
601 int r; in connect_child_process_cb() local
604 r = uv_read_start(req->handle, on_read_alloc, on_tcp_child_process_read); in connect_child_process_cb()
605 ASSERT_OK(r); in connect_child_process_cb()
610 int r; in ipc_on_connection() local
621 r = uv_tcp_init(server->loop, &conn.conn); in ipc_on_connection()
622 ASSERT_OK(r); in ipc_on_connection()
624 r = uv_accept(server, (uv_stream_t*)&conn.conn); in ipc_on_connection()
625 ASSERT_OK(r); in ipc_on_connection()
630 r = uv_write2(&conn_notify_req, (uv_stream_t*)&channel, &buf, 1, in ipc_on_connection()
632 ASSERT_OK(r); in ipc_on_connection()
645 int r; in ipc_on_connection_tcp_conn() local
655 r = uv_tcp_init(server->loop, conn); in ipc_on_connection_tcp_conn()
656 ASSERT_OK(r); in ipc_on_connection_tcp_conn()
658 r = uv_accept(server, (uv_stream_t*)conn); in ipc_on_connection_tcp_conn()
659 ASSERT_OK(r); in ipc_on_connection_tcp_conn()
663 r = uv_write2(&conn_notify_req, (uv_stream_t*)&channel, &buf, 1, in ipc_on_connection_tcp_conn()
665 ASSERT_OK(r); in ipc_on_connection_tcp_conn()
667 r = uv_read_start((uv_stream_t*) conn, in ipc_on_connection_tcp_conn()
670 ASSERT_OK(r); in ipc_on_connection_tcp_conn()
682 int r; in ipc_helper() local
687 r = uv_pipe_init(uv_default_loop(), &channel, 1); in ipc_helper()
688 ASSERT_OK(r); in ipc_helper()
696 r = uv_tcp_init(uv_default_loop(), &tcp_server); in ipc_helper()
697 ASSERT_OK(r); in ipc_helper()
699 r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); in ipc_helper()
700 ASSERT_OK(r); in ipc_helper()
703 r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection); in ipc_helper()
704 ASSERT_OK(r); in ipc_helper()
708 r = uv_write2(&write_req, (uv_stream_t*)&channel, &buf, 1, in ipc_helper()
710 ASSERT_OK(r); in ipc_helper()
713 r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection); in ipc_helper()
714 ASSERT_OK(r); in ipc_helper()
718 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in ipc_helper()
719 ASSERT_OK(r); in ipc_helper()
735 int r; in ipc_helper_tcp_connection() local
738 r = uv_pipe_init(uv_default_loop(), &channel, 1); in ipc_helper_tcp_connection()
739 ASSERT_OK(r); in ipc_helper_tcp_connection()
747 r = uv_tcp_init(uv_default_loop(), &tcp_server); in ipc_helper_tcp_connection()
748 ASSERT_OK(r); in ipc_helper_tcp_connection()
752 r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); in ipc_helper_tcp_connection()
753 ASSERT_OK(r); in ipc_helper_tcp_connection()
755 r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection_tcp_conn); in ipc_helper_tcp_connection()
756 ASSERT_OK(r); in ipc_helper_tcp_connection()
759 r = uv_tcp_init(uv_default_loop(), &conn.conn); in ipc_helper_tcp_connection()
760 ASSERT_OK(r); in ipc_helper_tcp_connection()
764 r = uv_tcp_connect(&conn.conn_req, in ipc_helper_tcp_connection()
768 ASSERT_OK(r); in ipc_helper_tcp_connection()
770 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in ipc_helper_tcp_connection()
771 ASSERT_OK(r); in ipc_helper_tcp_connection()
787 int r; in ipc_helper_bind_twice() local
792 r = uv_pipe_init(uv_default_loop(), &channel, 1); in ipc_helper_bind_twice()
793 ASSERT_OK(r); in ipc_helper_bind_twice()
803 r = uv_tcp_init(uv_default_loop(), &tcp_server); in ipc_helper_bind_twice()
804 ASSERT_OK(r); in ipc_helper_bind_twice()
805 r = uv_tcp_init(uv_default_loop(), &tcp_server2); in ipc_helper_bind_twice()
806 ASSERT_OK(r); in ipc_helper_bind_twice()
808 r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); in ipc_helper_bind_twice()
809 ASSERT_OK(r); in ipc_helper_bind_twice()
810 r = uv_tcp_bind(&tcp_server2, (const struct sockaddr*) &addr, 0); in ipc_helper_bind_twice()
811 ASSERT_OK(r); in ipc_helper_bind_twice()
813 r = uv_write2(&write_req, (uv_stream_t*)&channel, &buf, 1, in ipc_helper_bind_twice()
815 ASSERT_OK(r); in ipc_helper_bind_twice()
816 r = uv_write2(&write_req2, (uv_stream_t*)&channel, &buf, 1, in ipc_helper_bind_twice()
818 ASSERT_OK(r); in ipc_helper_bind_twice()
820 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in ipc_helper_bind_twice()
821 ASSERT_OK(r); in ipc_helper_bind_twice()
828 int r; in ipc_helper_send_zero() local
833 r = uv_pipe_init(uv_default_loop(), &channel, 0); in ipc_helper_send_zero()
834 ASSERT_OK(r); in ipc_helper_send_zero()
842 r = uv_write(&write_req, in ipc_helper_send_zero()
848 ASSERT_OK(r); in ipc_helper_send_zero()
850 r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); in ipc_helper_send_zero()
851 ASSERT_OK(r); in ipc_helper_send_zero()