Classes | Macros | Typedefs | Enumerations | Functions | Variables
test-poll.c File Reference
#include <errno.h>
#include <sys/socket.h>
#include <unistd.h>
#include "uv.h"
#include "task.h"
Include dependency graph for test-poll.c:

Go to the source code of this file.

Classes

struct  connection_context_s
 
struct  server_context_s
 

Macros

#define MIN(a, b)   (((a) < (b)) ? (a) : (b));
 
#define NUM_CLIENTS   5
 
#define TRANSFER_BYTES   (1 << 16)
 

Typedefs

typedef struct connection_context_s connection_context_t
 
typedef struct server_context_s server_context_t
 

Enumerations

enum  test_mode_t { UNIDIRECTIONAL, DUPLEX }
 

Functions

static void close_socket (uv_os_sock_t sock)
 
static void connection_close_cb (uv_handle_t *handle)
 
static void connection_poll_cb (uv_poll_t *handle, int status, int events)
 
static uv_os_sock_t create_bound_socket (struct sockaddr_in bind_addr)
 
static connection_context_tcreate_connection_context (uv_os_sock_t sock, int is_server_connection)
 
static server_context_tcreate_server_context (uv_os_sock_t sock)
 
static void delay_timer_cb (uv_timer_t *timer)
 
static void destroy_connection_context (connection_context_t *context)
 
static void destroy_server_context (server_context_t *context)
 
static int got_eagain (void)
 
static void server_close_cb (uv_handle_t *handle)
 
static void server_poll_cb (uv_poll_t *handle, int status, int events)
 
static void start_client (void)
 
static void start_poll_test (void)
 
static void start_server (void)
 
 TEST_IMPL (poll_bad_fdtype)
 
 TEST_IMPL (poll_duplex)
 
 TEST_IMPL (poll_unidirectional)
 

Variables

static int closed_connections = 0
 
static int disconnects = 0
 
static int spurious_writable_wakeups = 0
 
static test_mode_t test_mode = DUPLEX
 
static int valid_writable_wakeups = 0
 

Macro Definition Documentation

◆ MIN

#define MIN (   a,
  b 
)    (((a) < (b)) ? (a) : (b));

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

◆ NUM_CLIENTS

#define NUM_CLIENTS   5

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

◆ TRANSFER_BYTES

#define TRANSFER_BYTES   (1 << 16)

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

Typedef Documentation

◆ connection_context_t

◆ server_context_t

Enumeration Type Documentation

◆ test_mode_t

Enumerator
UNIDIRECTIONAL 
DUPLEX 

Definition at line 52 of file test-poll.c.

Function Documentation

◆ close_socket()

static void close_socket ( uv_os_sock_t  sock)
static

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

◆ connection_close_cb()

static void connection_close_cb ( uv_handle_t handle)
static

Definition at line 177 of file test-poll.c.

◆ connection_poll_cb()

static void connection_poll_cb ( uv_poll_t handle,
int  status,
int  events 
)
static

Definition at line 206 of file test-poll.c.

◆ create_bound_socket()

static uv_os_sock_t create_bound_socket ( struct sockaddr_in  bind_addr)
static

Definition at line 103 of file test-poll.c.

◆ create_connection_context()

static connection_context_t* create_connection_context ( uv_os_sock_t  sock,
int  is_server_connection 
)
static

Definition at line 144 of file test-poll.c.

◆ create_server_context()

static server_context_t* create_server_context ( uv_os_sock_t  sock)
static

Definition at line 461 of file test-poll.c.

◆ delay_timer_cb()

static void delay_timer_cb ( uv_timer_t timer)
static

Definition at line 442 of file test-poll.c.

◆ destroy_connection_context()

static void destroy_connection_context ( connection_context_t context)
static

Definition at line 200 of file test-poll.c.

◆ destroy_server_context()

static void destroy_server_context ( server_context_t context)
static

Definition at line 486 of file test-poll.c.

◆ got_eagain()

static int got_eagain ( void  )
static

Definition at line 89 of file test-poll.c.

◆ server_close_cb()

static void server_close_cb ( uv_handle_t handle)
static

Definition at line 480 of file test-poll.c.

◆ server_poll_cb()

static void server_poll_cb ( uv_poll_t handle,
int  status,
int  events 
)
static

Definition at line 491 of file test-poll.c.

◆ start_client()

static void start_client ( void  )
static

Definition at line 540 of file test-poll.c.

◆ start_poll_test()

static void start_poll_test ( void  )
static

Definition at line 564 of file test-poll.c.

◆ start_server()

static void start_server ( void  )
static

Definition at line 522 of file test-poll.c.

◆ TEST_IMPL() [1/3]

TEST_IMPL ( poll_bad_fdtype  )

Definition at line 621 of file test-poll.c.

◆ TEST_IMPL() [2/3]

TEST_IMPL ( poll_duplex  )

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

◆ TEST_IMPL() [3/3]

TEST_IMPL ( poll_unidirectional  )

Definition at line 606 of file test-poll.c.

Variable Documentation

◆ closed_connections

int closed_connections = 0
static

Definition at line 80 of file test-poll.c.

◆ disconnects

int disconnects = 0
static

Definition at line 86 of file test-poll.c.

◆ spurious_writable_wakeups

int spurious_writable_wakeups = 0
static

Definition at line 83 of file test-poll.c.

◆ test_mode

test_mode_t test_mode = DUPLEX
static

Definition at line 78 of file test-poll.c.

◆ valid_writable_wakeups

int valid_writable_wakeups = 0
static

Definition at line 82 of file test-poll.c.



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