2019-01-05 20:38:43 -08:00
|
|
|
/*
|
|
|
|
* IXNetSystem.h
|
|
|
|
* Author: Benjamin Sergeant
|
|
|
|
* Copyright (c) 2019 Machine Zone. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2019-05-30 08:46:50 -07:00
|
|
|
#include <WS2tcpip.h>
|
|
|
|
#include <WinSock2.h>
|
|
|
|
#include <basetsd.h>
|
|
|
|
#include <io.h>
|
|
|
|
#include <ws2def.h>
|
2019-08-19 22:26:25 -07:00
|
|
|
|
2019-09-08 11:14:49 -07:00
|
|
|
// Define our own poll on Windows, as a wrapper on top of select
|
2019-08-22 10:34:17 -07:00
|
|
|
typedef unsigned long int nfds_t;
|
|
|
|
|
2019-01-05 20:38:43 -08:00
|
|
|
#else
|
2019-05-30 08:46:50 -07:00
|
|
|
#include <arpa/inet.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <netdb.h>
|
2019-10-09 15:38:40 -07:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/ip.h>
|
2019-10-13 13:37:34 -07:00
|
|
|
#include <netinet/tcp.h>
|
2019-08-22 10:34:17 -07:00
|
|
|
#include <poll.h>
|
2019-05-30 08:46:50 -07:00
|
|
|
#include <sys/select.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <unistd.h>
|
2019-01-05 20:38:43 -08:00
|
|
|
#endif
|
2019-04-26 02:26:53 +03:00
|
|
|
|
|
|
|
namespace ix
|
|
|
|
{
|
|
|
|
bool initNetSystem();
|
|
|
|
bool uninitNetSystem();
|
2019-09-08 11:14:49 -07:00
|
|
|
|
|
|
|
int poll(struct pollfd* fds, nfds_t nfds, int timeout);
|
2019-05-30 08:46:50 -07:00
|
|
|
} // namespace ix
|