ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
network.c File Reference

🌐 Cross-platform socket I/O with timeout management and connection handling More...

Go to the source code of this file.

Functions

ssize_t send_with_timeout (socket_t sockfd, const void *data, size_t len, uint64_t timeout_ns)
 Send data with timeout using chunked transmission.
 
ssize_t recv_with_timeout (socket_t sockfd, void *buf, size_t len, uint64_t timeout_ns)
 Receive data with timeout.
 
int accept_with_timeout (socket_t listenfd, struct sockaddr *addr, socklen_t *addrlen, uint64_t timeout_ns)
 Accept connection with timeout.
 
asciichat_error_t set_socket_timeout (socket_t sockfd, uint64_t timeout_ns)
 Set socket timeout.
 
asciichat_error_t set_socket_keepalive (socket_t sockfd)
 Set socket keepalive.
 
asciichat_error_t set_socket_nonblocking (socket_t sockfd)
 Set socket non-blocking.
 
asciichat_error_t socket_configure_buffers (socket_t sockfd)
 Configure socket buffers and TCP_NODELAY for optimal performance.
 
const char * network_error_string ()
 Get human-readable error string for network errors.
 
bool connect_with_timeout (socket_t sockfd, const struct sockaddr *addr, socklen_t addrlen, int timeout_seconds)
 Connect with timeout.
 

Detailed Description

🌐 Cross-platform socket I/O with timeout management and connection handling

Definition in file network/network.c.