98#define CONNECT_TIMEOUT 3
108#define SEND_TIMEOUT 5
118#define RECV_TIMEOUT 15
128#define ACCEPT_TIMEOUT 3
147#define network_is_test_environment() ((int)is_test_environment())
168#define KEEPALIVE_IDLE 60
177#define KEEPALIVE_INTERVAL 10
186#define KEEPALIVE_COUNT 8
asciichat_error_t
Error and exit codes - unified status values (0-255)
asciichat_error_t set_socket_timeout(socket_t sockfd, int timeout_seconds)
Set socket timeout for send/receive operations.
asciichat_error_t set_socket_keepalive(socket_t sockfd)
Enable TCP keepalive on socket.
asciichat_error_t set_socket_nonblocking(socket_t sockfd)
Set socket to non-blocking mode.
ssize_t send_with_timeout(socket_t sockfd, const void *data, size_t len, int timeout_seconds)
Send data with timeout using chunked transmission.
bool connect_with_timeout(socket_t sockfd, const struct sockaddr *addr, socklen_t addrlen, int timeout_seconds)
Connect to server with timeout.
int accept_with_timeout(socket_t listenfd, struct sockaddr *addr, socklen_t *addrlen, int timeout_seconds)
Accept connection with timeout.
const char * network_error_string()
Get human-readable error string for network errors.
asciichat_error_t socket_configure_buffers(socket_t sockfd)
Configure socket buffers and TCP_NODELAY for optimal performance.
ssize_t recv_with_timeout(socket_t sockfd, void *buf, size_t len, int timeout_seconds)
Receive data with timeout.
Cross-platform socket interface for ascii-chat.
Test environment detection utilities.