ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
tcp_server_config_t Struct Reference

TCP server configuration. More...

#include <include/ascii-chat/network/tcp/server.h>

Data Fields

int port
 TCP listen port.
 
const char * ipv4_address
 IPv4 bind address (NULL or empty = don't bind)
 
const char * ipv6_address
 IPv6 bind address (NULL or empty = don't bind)
 
bool bind_ipv4
 Whether to bind IPv4 socket.
 
bool bind_ipv6
 Whether to bind IPv6 socket.
 
double accept_timeout_sec
 select() timeout in seconds (supports decimals, e.g. 0.05 for 50ms)
 
tcp_client_handler_fn client_handler
 Client handler callback.
 
void * user_data
 User data passed to each client handler.
 
tcp_status_update_fn status_update_fn
 Optional status update callback (called on timeout, NULL to disable)
 
void * status_update_data
 User data passed to status update callback.
 

Detailed Description

TCP server configuration.

Configures server binding, timeouts, and client handler.

Definition at line 138 of file include/ascii-chat/network/tcp/server.h.

Field Documentation

◆ accept_timeout_sec

double tcp_server_config_t::accept_timeout_sec

select() timeout in seconds (supports decimals, e.g. 0.05 for 50ms)

Definition at line 144 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_run().

◆ bind_ipv4

bool tcp_server_config_t::bind_ipv4

Whether to bind IPv4 socket.

Definition at line 142 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_init().

◆ bind_ipv6

bool tcp_server_config_t::bind_ipv6

Whether to bind IPv6 socket.

Definition at line 143 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_init().

◆ client_handler

tcp_client_handler_fn tcp_server_config_t::client_handler

Client handler callback.

Definition at line 145 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_run().

◆ ipv4_address

const char* tcp_server_config_t::ipv4_address

IPv4 bind address (NULL or empty = don't bind)

Definition at line 140 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_init().

◆ ipv6_address

const char* tcp_server_config_t::ipv6_address

IPv6 bind address (NULL or empty = don't bind)

Definition at line 141 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_init().

◆ port

int tcp_server_config_t::port

TCP listen port.

Definition at line 139 of file include/ascii-chat/network/tcp/server.h.

Referenced by session_server_like_run(), and tcp_server_init().

◆ status_update_data

void* tcp_server_config_t::status_update_data

User data passed to status update callback.

Definition at line 148 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_run().

◆ status_update_fn

tcp_status_update_fn tcp_server_config_t::status_update_fn

Optional status update callback (called on timeout, NULL to disable)

Definition at line 147 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_run().

◆ user_data

void* tcp_server_config_t::user_data

User data passed to each client handler.

Definition at line 146 of file include/ascii-chat/network/tcp/server.h.

Referenced by tcp_server_run().


The documentation for this struct was generated from the following file: