IXWebSocket/ixwebsocket/IXNetSystem.h

39 lines
687 B
C
Raw Normal View History

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
// Define our own poll on Windows
typedef unsigned long int nfds_t;
int poll(struct pollfd* fds, nfds_t nfds, int timeout);
2019-08-20 07:26:25 +02:00
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>
#include <netinet/tcp.h>
#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
namespace ix
{
bool initNetSystem();
bool uninitNetSystem();
2019-05-30 17:46:50 +02:00
} // namespace ix