mirror of
https://github.com/open-goal/jak-project
synced 2026-08-03 08:53:42 -04:00
19 lines
467 B
C
19 lines
467 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_IP;
|
|
#endif
|
|
|
|
void close_socket(int sock);
|
|
int set_socket_option(int socket, int level, int optname, int optval, int optlen);
|
|
int write_to_socket(int socket, const char* buf, int len);
|
|
int read_from_socket(int socket, char* buf, int len);
|