Classes | Macros | Functions | Variables
test-ipc.c File Reference
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for test-ipc.c:

Go to the source code of this file.

Classes

struct  tcp_conn
 

Macros

#define BACKLOG   128
 
#define CONN_COUNT   100
 
#define LARGE_SIZE   100000
 

Functions

static void close_cb (uv_handle_t *handle)
 
static void close_client_conn_cb (uv_handle_t *handle)
 
static void close_server_conn_cb (uv_handle_t *handle)
 
static void closed_handle_large_write_cb (uv_write_t *req, int status)
 
static void closed_handle_write_cb (uv_write_t *req, int status)
 
static void conn_notify_write_cb (uv_write_t *req, int status)
 
static void connect_cb (uv_connect_t *req, int status)
 
static void connect_child_process_cb (uv_connect_t *req, int status)
 
static void exit_cb (uv_process_t *process, int64_t exit_status, int term_signal)
 
int ipc_helper (int listen_after_write)
 
int ipc_helper_bind_twice (void)
 
int ipc_helper_closed_handle (void)
 
int ipc_helper_send_zero (void)
 
int ipc_helper_tcp_connection (void)
 
static void ipc_on_connection (uv_stream_t *server, int status)
 
static void ipc_on_connection_tcp_conn (uv_stream_t *server, int status)
 
static void make_many_connections (void)
 
static void on_alloc (uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
 
static void on_connection (uv_stream_t *server, int status)
 
static void on_read (uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
 
static void on_read_alloc (uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
 
static void on_read_closed_handle (uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
 
static void on_read_connection (uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
 
static void on_read_send_zero (uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
 
static void on_tcp_child_process_read (uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
 
static void on_tcp_read (uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
 
static void on_tcp_write (uv_write_t *req, int status)
 
static int run_ipc_test (const char *helper, uv_read_cb read_cb)
 
static void send_handle_and_close (void)
 
static void send_zero_write_cb (uv_write_t *req, int status)
 
void spawn_helper (uv_pipe_t *channel, uv_process_t *process, const char *helper)
 
static void tcp_connection_write_cb (uv_write_t *req, int status)
 
 TEST_IMPL (ipc_closed_handle)
 
 TEST_IMPL (ipc_listen_after_write)
 
 TEST_IMPL (ipc_listen_before_write)
 
 TEST_IMPL (ipc_send_zero)
 
 TEST_IMPL (ipc_tcp_connection)
 
static unsigned int write_until_data_queued (void)
 

Variables

static char buffer [LARGE_SIZE]
 
static uv_pipe_t channel
 
static int close_cb_called
 
static int closed_handle_data_read
 
static int closed_handle_write
 
static tcp_conn conn
 
static uv_write_t conn_notify_req
 
static int connection_accepted
 
static int exit_cb_called
 
static uv_buf_t large_buf
 
static int local_conn_accepted
 
static int on_pipe_read_called
 
static int read_cb_called
 
static int remote_conn_accepted
 
static int send_zero_write
 
static int tcp_conn_read_cb_called
 
static int tcp_conn_write_cb_called
 
static uv_tcp_t tcp_connection
 
static int tcp_read_cb_called
 
static uv_tcp_t tcp_server
 
static uv_tcp_t tcp_server2
 
static int tcp_server_listening
 
static int tcp_write_cb_called
 
static uv_write_t write_req
 
static uv_write_t write_req2
 
static uv_write_t write_reqs [300]
 
static int write_reqs_completed
 

Macro Definition Documentation

◆ BACKLOG

#define BACKLOG   128

Definition at line 59 of file test-ipc.c.

◆ CONN_COUNT

#define CONN_COUNT   100

Definition at line 58 of file test-ipc.c.

◆ LARGE_SIZE

#define LARGE_SIZE   100000

Definition at line 60 of file test-ipc.c.

Function Documentation

◆ close_cb()

static void close_cb ( uv_handle_t handle)
static

Definition at line 585 of file test-ipc.c.

◆ close_client_conn_cb()

static void close_client_conn_cb ( uv_handle_t handle)
static

Definition at line 119 of file test-ipc.c.

◆ close_server_conn_cb()

static void close_server_conn_cb ( uv_handle_t handle)
static

Definition at line 71 of file test-ipc.c.

◆ closed_handle_large_write_cb()

static void closed_handle_large_write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 605 of file test-ipc.c.

◆ closed_handle_write_cb()

static void closed_handle_write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 616 of file test-ipc.c.

◆ conn_notify_write_cb()

static void conn_notify_write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 590 of file test-ipc.c.

◆ connect_cb()

static void connect_cb ( uv_connect_t req,
int  status 
)
static

Definition at line 125 of file test-ipc.c.

◆ connect_child_process_cb()

static void connect_child_process_cb ( uv_connect_t req,
int  status 
)
static

Definition at line 657 of file test-ipc.c.

◆ exit_cb()

static void exit_cb ( uv_process_t process,
int64_t  exit_status,
int  term_signal 
)
static

Definition at line 100 of file test-ipc.c.

◆ ipc_helper()

int ipc_helper ( int  listen_after_write)

Definition at line 728 of file test-ipc.c.

◆ ipc_helper_bind_twice()

int ipc_helper_bind_twice ( void  )

Definition at line 903 of file test-ipc.c.

◆ ipc_helper_closed_handle()

int ipc_helper_closed_handle ( void  )

Definition at line 875 of file test-ipc.c.

◆ ipc_helper_send_zero()

int ipc_helper_send_zero ( void  )

Definition at line 949 of file test-ipc.c.

◆ ipc_helper_tcp_connection()

int ipc_helper_tcp_connection ( void  )

Definition at line 781 of file test-ipc.c.

◆ ipc_on_connection()

static void ipc_on_connection ( uv_stream_t server,
int  status 
)
static

Definition at line 666 of file test-ipc.c.

◆ ipc_on_connection_tcp_conn()

static void ipc_on_connection_tcp_conn ( uv_stream_t server,
int  status 
)
static

Definition at line 696 of file test-ipc.c.

◆ make_many_connections()

static void make_many_connections ( void  )
static

Definition at line 130 of file test-ipc.c.

◆ on_alloc()

static void on_alloc ( uv_handle_t handle,
size_t  suggested_size,
uv_buf_t buf 
)
static

Definition at line 111 of file test-ipc.c.

◆ on_connection()

static void on_connection ( uv_stream_t server,
int  status 
)
static

Definition at line 76 of file test-ipc.c.

◆ on_read()

static void on_read ( uv_stream_t handle,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 154 of file test-ipc.c.

◆ on_read_alloc()

static void on_read_alloc ( uv_handle_t handle,
size_t  suggested_size,
uv_buf_t buf 
)
static

Definition at line 340 of file test-ipc.c.

◆ on_read_closed_handle()

static void on_read_closed_handle ( uv_stream_t handle,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 421 of file test-ipc.c.

◆ on_read_connection()

static void on_read_connection ( uv_stream_t handle,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 361 of file test-ipc.c.

◆ on_read_send_zero()

static void on_read_send_zero ( uv_stream_t handle,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 440 of file test-ipc.c.

◆ on_tcp_child_process_read()

static void on_tcp_child_process_read ( uv_stream_t tcp,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 627 of file test-ipc.c.

◆ on_tcp_read()

static void on_tcp_read ( uv_stream_t tcp,
ssize_t  nread,
const uv_buf_t buf 
)
static

Definition at line 348 of file test-ipc.c.

◆ on_tcp_write()

static void on_tcp_write ( uv_write_t req,
int  status 
)
static

Definition at line 333 of file test-ipc.c.

◆ run_ipc_test()

static int run_ipc_test ( const char *  helper,
uv_read_cb  read_cb 
)
static

Definition at line 448 of file test-ipc.c.

◆ send_handle_and_close()

static void send_handle_and_close ( void  )
static

Definition at line 852 of file test-ipc.c.

◆ send_zero_write_cb()

static void send_zero_write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 622 of file test-ipc.c.

◆ spawn_helper()

void spawn_helper ( uv_pipe_t channel,
uv_process_t process,
const char *  helper 
)

Definition at line 291 of file test-ipc.c.

◆ tcp_connection_write_cb()

static void tcp_connection_write_cb ( uv_write_t req,
int  status 
)
static

Definition at line 596 of file test-ipc.c.

◆ TEST_IMPL() [1/5]

TEST_IMPL ( ipc_closed_handle  )

Definition at line 502 of file test-ipc.c.

◆ TEST_IMPL() [2/5]

TEST_IMPL ( ipc_listen_after_write  )

Definition at line 476 of file test-ipc.c.

◆ TEST_IMPL() [3/5]

TEST_IMPL ( ipc_listen_before_write  )

Definition at line 463 of file test-ipc.c.

◆ TEST_IMPL() [4/5]

TEST_IMPL ( ipc_send_zero  )

Definition at line 572 of file test-ipc.c.

◆ TEST_IMPL() [5/5]

TEST_IMPL ( ipc_tcp_connection  )

Definition at line 489 of file test-ipc.c.

◆ write_until_data_queued()

static unsigned int write_until_data_queued ( void  )
static

Definition at line 833 of file test-ipc.c.

Variable Documentation

◆ buffer

char buffer[LARGE_SIZE]
static

Definition at line 63 of file test-ipc.c.

◆ channel

uv_pipe_t channel
static

Definition at line 28 of file test-ipc.c.

◆ close_cb_called

int close_cb_called
static

Definition at line 44 of file test-ipc.c.

◆ closed_handle_data_read

int closed_handle_data_read
static

Definition at line 48 of file test-ipc.c.

◆ closed_handle_write

int closed_handle_write
static

Definition at line 49 of file test-ipc.c.

◆ conn

tcp_conn conn
static

Definition at line 582 of file test-ipc.c.

◆ conn_notify_req

uv_write_t conn_notify_req
static

Definition at line 43 of file test-ipc.c.

◆ connection_accepted

int connection_accepted
static

Definition at line 45 of file test-ipc.c.

◆ exit_cb_called

int exit_cb_called
static

Definition at line 33 of file test-ipc.c.

◆ large_buf

uv_buf_t large_buf
static

Definition at line 62 of file test-ipc.c.

◆ local_conn_accepted

int local_conn_accepted
static

Definition at line 38 of file test-ipc.c.

◆ on_pipe_read_called

int on_pipe_read_called
static

Definition at line 37 of file test-ipc.c.

◆ read_cb_called

int read_cb_called
static

Definition at line 34 of file test-ipc.c.

◆ remote_conn_accepted

int remote_conn_accepted
static

Definition at line 39 of file test-ipc.c.

◆ send_zero_write

int send_zero_write
static

Definition at line 50 of file test-ipc.c.

◆ tcp_conn_read_cb_called

int tcp_conn_read_cb_called
static

Definition at line 46 of file test-ipc.c.

◆ tcp_conn_write_cb_called

int tcp_conn_write_cb_called
static

Definition at line 47 of file test-ipc.c.

◆ tcp_connection

uv_tcp_t tcp_connection
static

Definition at line 31 of file test-ipc.c.

◆ tcp_read_cb_called

int tcp_read_cb_called
static

Definition at line 36 of file test-ipc.c.

◆ tcp_server

uv_tcp_t tcp_server
static

Definition at line 29 of file test-ipc.c.

◆ tcp_server2

uv_tcp_t tcp_server2
static

Definition at line 30 of file test-ipc.c.

◆ tcp_server_listening

int tcp_server_listening
static

Definition at line 40 of file test-ipc.c.

◆ tcp_write_cb_called

int tcp_write_cb_called
static

Definition at line 35 of file test-ipc.c.

◆ write_req

Definition at line 41 of file test-ipc.c.

◆ write_req2

uv_write_t write_req2
static

Definition at line 42 of file test-ipc.c.

◆ write_reqs

uv_write_t write_reqs[300]
static

Definition at line 64 of file test-ipc.c.

◆ write_reqs_completed

int write_reqs_completed
static

Definition at line 65 of file test-ipc.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:33