Files
jak-project/common/cross_sockets/xsocket.h
T
water111 01883da47e Fix Listener Socket Timeout on Windows (#28)
* try checking for timeouts differently on windows

* hopefully this test fails on windows

* hopefully this test passes on windows

* remove debug prints

* remove commented otu code
2020-09-09 20:14:13 -04:00

21 lines
604 B
C

#ifdef __linux
#include <sys/socket.h>
#include <netinet/tcp.h>
#include <unistd.h>
#elif _WIN32
#include <WinSock2.h>
#endif
#ifdef __linux
const int TCP_SOCKET_LEVEL = SOL_TCP;
#elif _WIN32
const int TCP_SOCKET_LEVEL = IPPROTO_TCP;
#endif
int open_socket(int af, int type, int protocol);
void close_socket(int sock);
int set_socket_option(int socket, int level, int optname, const void* optval, int optlen);
int set_socket_timeout(int socket, long microSeconds);
int write_to_socket(int socket, const char* buf, int len);
int read_from_socket(int socket, char* buf, int len);
bool socket_timed_out();