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