Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Types.h
Go to the documentation of this file.
1#ifndef ULT_NETWORK_TYPES_H_INCLUDED
2#define ULT_NETWORK_TYPES_H_INCLUDED
3
4#ifdef _WIN32
5
6#include <winsock2.h>
7typedef int socklen_t;
8#define IOCTL_TYPE unsigned long
9typedef SOCKET ULT_SOCKET;
10#else
11
12#include <unistd.h>
13#include <sys/time.h>
14#include <sys/types.h>
15#include <sys/socket.h>
16#include <netinet/in.h>
17#include <cerrno>
18#include <arpa/inet.h>
19#include <netdb.h>
20#include <sys/ioctl.h>
21
22#define INVALID_SOCKET -1
23#define SOCKET_ERROR -1
24
25#define ioctlsocket ioctl
26#define IOCTL_TYPE char
27
29typedef int ULT_SOCKET;
30
31#endif // #ifdef _WIN32
32
33namespace Ult
34{
35
47
49enum class NetType
50{
51 Null = 0,
54};
55
64
66typedef char NetPacketValue;
68constexpr size_t MAX_PACKET_SIZE = 256;
77typedef void (*NetCallback)(int u, int y, char* d, int s);
79constexpr char NetSystemUsage = 0;
80
81} // namespace Ult
82
83#endif // ULT_NETWORK_TYPES_H_INCLUDED
84
char NetPacketValue
Definition Types.h:66
constexpr char NetSystemUsage
Definition Types.h:79
NetMsgType
Definition Types.h:38
int ULT_SOCKET
Definition Types.h:29
void(* NetCallback)(int u, int y, char *d, int s)
Definition Types.h:77
NetType
Definition Types.h:50
NetResult
Definition Types.h:58
constexpr size_t MAX_PACKET_SIZE
Definition Types.h:68
@ RespondOk
Definition Types.h:45
@ ForceDisconnect
Definition Types.h:41
@ ServerDisconnect
Definition Types.h:39
@ RespondRequire
Definition Types.h:44
@ SendError
Definition Types.h:43
@ ConnectAccepted
Definition Types.h:42
@ ClientDisconnect
Definition Types.h:40
@ Client
Definition Types.h:53
@ Server
Definition Types.h:52
@ Null
Definition Types.h:51
@ DataSuccess
Definition Types.h:62
@ PartialData
Definition Types.h:61
@ NoData
Definition Types.h:59
@ DataFail
Definition Types.h:60
Definition Archive.h:13