EHS
Socket.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/Str.h"
4
5#ifndef EHS_IPV4_HEADER
6 #define EHS_IPV4_HEADER 60
7#include <string>
8#endif
9
10#ifndef EHS_IPV6_HEADER
11 #define EHS_IPV6_HEADER 40
12#endif
13
14#ifndef EHS_UDP_HEADER
15 #define EHS_UDP_HEADER 8
16#endif
17
18#ifndef EHS_IPV4_UDP_PAYLOAD
19 #define EHS_IPV4_UDP_PAYLOAD (EHS_UINT_16_MAX - EHS_IPV4_HEADER - EHS_UDP_HEADER)
20#endif
21
22#ifndef EHS_IPV6_UDP_PAYLOAD
23 #define EHS_IPV6_UDP_PAYLOAD (EHS_UINT_16_MAX - EHS_IPV6_HEADER - EHS_UDP_HEADER)
24#endif
25
26namespace ehs
27{
28 enum class IP
29 {
30 V4,
31 V6
32 };
33
34 enum class ContentType
35 {
40 APP_XML,
44 NONE
45 };
46
47 struct Endpoint
48 {
52 };
53
54#if defined(EHS_OS_WINDOWS)
55 typedef UInt_64 Socket;
56 #define EHS_INVALID_SOCKET EHS_UINT_64_MAX
57#elif defined(EHS_OS_LINUX)
58 typedef SInt_32 Socket;
59 #define EHS_INVALID_SOCKET (SInt_32)0xffffffff
60#endif
61}
Definition: Anchor.h:6
signed int SInt_32
Definition: Types.h:50
IP
Definition: Socket.h:29
ContentType
Definition: Socket.h:35
unsigned short UInt_16
Definition: Types.h:46
Definition: Socket.h:48
IP version
Definition: Socket.h:49
UInt_16 port
Definition: Socket.h:51
Str_8 address
Definition: Socket.h:50