17#if defined(_WIN32) && !defined(__CYGWIN__)
23 #define socket_handle_t SOCKET
30 #include <sys/types.h>
31 #include <sys/socket.h>
32 #include <arpa/inet.h>
33 #include <netinet/in.h>
35 #define closesocket(socket) close(socket)
36 #define socket_handle_t int
38 #define INVALID_SOCKET (-1)
40 #define SOCKET_ERROR (-1)
75WS_DLL_PUBLIC
int ws_socket_ptoa(
struct sockaddr_storage *dst,
const char *src, uint16_t def_port);
WS_DLL_PUBLIC void ws_cleanup_sockets(void)
Cleans up the socket subsystem.
Definition socket.c:46
WS_DLL_PUBLIC int ws_socket_ptoa(struct sockaddr_storage *dst, const char *src, uint16_t def_port)
Converts a string representation of an IP address and port into a sockaddr.
Definition socket.c:55
WS_DLL_PUBLIC char * ws_init_sockets(void)
Initializes the socket subsystem.
Definition socket.c:27