Go to the documentation of this file.
58 #define CONN_COUNT 100
60 #define LARGE_SIZE 100000
112 size_t suggested_size,
114 buf->base = malloc(suggested_size);
115 buf->len = suggested_size;
132 struct sockaddr_in
addr;
145 (
const struct sockaddr*) &
addr,
171 if (nread == UV_EOF) {
180 fprintf(
stderr,
"got %d bytes\n", (
int)nread);
212 }
else if (memcmp(
"accepted_connection\n",
buf->base, nread) == 0) {
240 if (nread == UV_EOF) {
249 fprintf(
stderr,
"got %d bytes\n", (
int)nread);
293 const char* helper) {
311 args[1] = (
char*)helper;
341 size_t suggested_size,
343 buf->base = malloc(suggested_size);
344 buf->len = suggested_size;
377 if (nread == UV_EOF) {
386 fprintf(
stderr,
"got %d bytes\n", (
int)nread);
424 if (nread == 0 || nread == UV_EOF) {
443 ASSERT(nread == 0 || nread == UV_EOF);
464 #if defined(NO_SEND_HANDLE_ON_PIPE)
477 #if defined(NO_SEND_HANDLE_ON_PIPE)
490 #if defined(NO_SEND_HANDLE_ON_PIPE)
512 TEST_IMPL(listen_with_simultaneous_accepts) {
515 struct sockaddr_in
addr;
537 TEST_IMPL(listen_no_simultaneous_accepts) {
540 struct sockaddr_in
addr;
562 #if defined(NO_SEND_HANDLE_ON_PIPE)
565 int r =
run_ipc_test(
"ipc_helper_bind_twice", on_read_listen_after_bound_twice);
634 if (nread == UV_EOF) {
733 struct sockaddr_in
addr;
754 if (!listen_after_write) {
764 if (listen_after_write) {
788 struct sockaddr_in
addr;
818 (
const struct sockaddr*) &
addr,
846 }
while (
channel.write_queue_size == 0 &&
849 return channel.write_queue_size;
854 struct sockaddr_in
addr;
908 struct sockaddr_in
addr;
static uv_write_t write_reqs[300]
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t *handle)
static int closed_handle_write
static void on_tcp_read(uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
static int close_cb_called
static uv_write_t write_req
#define ASSERT_NE(val1, val2)
static uv_write_t write_req2
#define ARRAY_SIZE(array)
static void read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
TEST_IMPL(ipc_listen_before_write)
return memset(p, 0, total)
static void ipc_on_connection_tcp_conn(uv_stream_t *server, int status)
UV_EXTERN int uv_pipe_init(uv_loop_t *, uv_pipe_t *handle, int ipc)
static void ipc_on_connection(uv_stream_t *server, int status)
static int tcp_conn_write_cb_called
static void connect_child_process_cb(uv_connect_t *req, int status)
static int tcp_server_listening
static int send_zero_write
int ipc_helper_tcp_connection(void)
static void on_read_send_zero(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
unsigned char outbuf[SIZE]
static void tcp_connection_write_cb(uv_write_t *req, int status)
UV_EXTERN int uv_listen(uv_stream_t *stream, int backlog, uv_connection_cb cb)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
static uv_tcp_t tcp_server2
UV_EXTERN int uv_tcp_simultaneous_accepts(uv_tcp_t *handle, int enable)
void(* uv_read_cb)(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
static uv_buf_t large_buf
static void close_server_conn_cb(uv_handle_t *handle)
static void connect_cb(uv_connect_t *req, int status)
const UV_EXTERN char * uv_strerror(int err)
static void close_client_conn_cb(uv_handle_t *handle)
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
UV_EXTERN int uv_is_closing(const uv_handle_t *handle)
static void make_many_connections(void)
static void on_alloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
UV_EXTERN int uv_tcp_bind(uv_tcp_t *handle, const struct sockaddr *addr, unsigned int flags)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
static int read_cb_called
UV_EXTERN int uv_tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, uv_connect_cb cb)
UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
static void close_cb(uv_handle_t *handle)
static char exepath[1024]
static void on_tcp_child_process_read(uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
std::unique_ptr< Server > server
UV_EXTERN uv_loop_t * uv_default_loop(void)
int ipc_helper(int listen_after_write)
static uv_process_t process
static void conn_notify_write_cb(uv_write_t *req, int status)
static void on_read_connection(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
static int local_conn_accepted
int ipc_helper_send_zero(void)
UV_EXTERN int uv_write(uv_write_t *req, uv_stream_t *handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb)
UV_EXTERN int uv_is_readable(const uv_stream_t *handle)
static uv_tcp_t tcp_connection
static void closed_handle_large_write_cb(uv_write_t *req, int status)
void spawn_helper(uv_pipe_t *channel, uv_process_t *process, const char *helper)
int ipc_helper_bind_twice(void)
static void on_tcp_write(uv_write_t *req, int status)
UV_EXTERN int uv_read_start(uv_stream_t *, uv_alloc_cb alloc_cb, uv_read_cb read_cb)
static uv_tcp_t tcp_server
static void send_zero_write_cb(uv_write_t *req, int status)
static int tcp_write_cb_called
UV_EXTERN int uv_tcp_init(uv_loop_t *, uv_tcp_t *handle)
UV_EXTERN int uv_accept(uv_stream_t *server, uv_stream_t *client)
static void on_read_closed_handle(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
#define ASSERT_NOT_NULL(a)
UV_EXTERN int uv_spawn(uv_loop_t *loop, uv_process_t *handle, const uv_process_options_t *options)
void notify_parent_process(void)
UV_EXTERN int uv_exepath(char *buffer, size_t *size)
int ipc_helper_closed_handle(void)
static void closed_handle_write_cb(uv_write_t *req, int status)
#define MAKE_VALGRIND_HAPPY()
#define ASSERT_PTR_EQ(a, b)
static void on_connection(uv_stream_t *server, int status)
static size_t exepath_size
static int exit_cb_called
static int write_reqs_completed
static void on_read_alloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t *handle)
UV_HANDLE_FIELDS UV_STREAM_FIELDS int ipc
static void exit_cb(uv_process_t *process, int64_t exit_status, int term_signal)
UV_EXTERN uv_buf_t uv_buf_init(char *base, unsigned int len)
static int tcp_read_cb_called
static int closed_handle_data_read
static int connection_accepted
#define ASSERT_MEM_EQ(a, b, size)
#define RETURN_SKIP(explanation)
union uv_stdio_container_s::@399 data
static int remote_conn_accepted
static int on_pipe_read_called
UV_EXTERN int uv_write2(uv_write_t *req, uv_stream_t *handle, const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t *send_handle, uv_write_cb cb)
UV_EXTERN int uv_is_writable(const uv_stream_t *handle)
#define ASSERT_GT(val1, val2)
static void on_read(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
static int run_ipc_test(const char *helper, uv_read_cb read_cb)
static char buffer[LARGE_SIZE]
static uv_write_t conn_notify_req
UV_EXTERN int uv_pipe_open(uv_pipe_t *, uv_file file)
static void send_handle_and_close(void)
static unsigned int write_until_data_queued(void)
#define ASSERT_EQ(val1, val2)
static int tcp_conn_read_cb_called
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:30