17#if defined(_WIN32) && !defined(__CYGWIN__)
23 #define socket_handle_t SOCKET
35 #ifdef HAVE_SYS_SOCKET_H
36 #include <sys/socket.h>
39 #define closesocket(socket) close(socket)
40 #define socket_handle_t int
42 #define INVALID_SOCKET (-1)
44 #define SOCKET_ERROR (-1)
47#ifdef HAVE_ARPA_INET_H
48 #include <arpa/inet.h>
51#ifdef HAVE_NETINET_IN_H
52 #include <netinet/in.h>
87WS_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