Go to the documentation of this file.
23 #include <sys/types.h>
24 #include <sys/socket.h>
25 #include <netinet/in.h>
26 #include <arpa/inet.h>
40 #include "../../utils/logger.h"
struct socket_client socket_client
addr_info default_hints()
generates an addr_info struct with defaults defaults is IPv4, TCP, and AI_PASSIVE flags
int get_new_socket(thread_logger *thl, addr_info *bind_address, SOCKET_OPTS sock_opts[], int num_opts)
gets an available socket attached to bind_address
void signal_handler_fn(int signal_number)
callback function used to handle OS signals shouldn't be called directly and instead used as the func...
alias for struct sockaddr_storage
pthread_mutex_t _signal_mutex
used to lock writes for _do_exit
void setup_signal_handling()
prepares library for usage
alias for struct sockaddr
bool _do_exit
used to indicate when threads need to cleanup
socket_client * new_socket_client(thread_logger *thl, addr_info hints, char *addr, char *port)
returns a new socket client connected to addr:port
bool set_socket_blocking_status(int fd, bool blocking)
used to enable/disable blocking sockets
SOCKET_OPTS
used to configure new sockets
alias for struct addrinfo
char * get_name_info(sock_addr *client_address)
returns the address the client is connecting from