Go to the documentation of this file.
17 #include <sys/types.h>
18 #include <sys/socket.h>
19 #include <netinet/in.h>
20 #include <arpa/inet.h>
35 #include "../../utils/logger.h"
36 #include "../../sync/wait_group.h"
void(* log_fnf)(struct thread_logger *thl, int file_descriptor, LOG_LEVELS level, char *message,...)
alias for struct sockaddr_storage
void(* log_fn)(struct thread_logger *thl, int file_descriptor, char *message, LOG_LEVELS level)
void * async_listen_func(void *data)
listens for new connections and spawns a thread to process the connection thread that is created to p...
socket_server * new_socket_server(addr_info hints, thread_logger *thl, int max_conns, char *port)
returns a new socket server bound to the port number and ready to accept connections
void * async_handle_conn_func(void *data)
handles connections in a dedicated pthread is laucnched in a pthread by async_listen_func when any ...
struct conn_handle_data conn_handle_data
a structure containing a file descriptor and address information
struct socket_server socket_server
a generic tcp socket server using file descriptor socket_number it uses a dedicated pthread for accep...
struct containing arguments passed into pthread
struct client_conn client_conn
sock_addr_storage * address
client_conn * accept_client_conn(socket_server *srv)
helper function for accepting client connections times out new attempts if they take 3 seconds or mor...
TCP socket servers, clients, and tooling for working with sockets.
alias for struct addrinfo