EHS
Loading...
Searching...
No Matches
NetUtils.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/Serializer.h"
4
5namespace ehs
6{
14
16 {
19 };
20
21 struct Header
22 {
24 UInt_64 encId = 0;
26 UInt_64 channelId = 0;
29 UInt_64 id = 0;
30 UInt_64 fragmentCount = 0;
31 UInt_64 fragment = 0;
32 bool ensure = false;
33 Char_8 token[64] = {};
34 UInt_64 systemId = 0;
35 UInt_64 opId = 0;
36 };
37
38 void WriteHeader(const Header &header, Serializer<UInt_64> &data);
39
41
47
54}
55
56#ifndef EHC_IPV4_PAYLOAD
57 #define EHC_IPV4_PAYLOAD (EHS_IPV4_UDP_PAYLOAD - (UInt_16)sizeof(Header))
58#endif
59
60#ifndef EHC_IPV6_PAYLOAD
61 #define EHC_IPV6_PAYLOAD (EHS_IPV6_UDP_PAYLOAD - (UInt_16)sizeof(Header))
62#endif
Definition Serializer.h:25
A helper class for storing version major, minor and patch.
Definition Version.h:9
Definition Anchor.h:6
Header ReadHeader(Serializer< UInt_64 > &data)
Definition NetUtils.cpp:22
@ ACTIVE
Definition BaseAudioDevice.h:20
NetStatus
Definition NetUtils.h:8
@ DISCONNECTED
Definition NetUtils.h:9
@ QUEUED
Definition NetUtils.h:12
@ PENDING
Definition NetUtils.h:11
void WriteHeader(const Header &header, Serializer< UInt_64 > &data)
Definition NetUtils.cpp:5
char Char_8
Definition Types.h:40
unsigned char UInt_8
Definition Types.h:43
NetChannelType
Definition NetUtils.h:16
@ SERVER
Definition NetUtils.h:17
@ CLIENT
Definition NetUtils.h:18
Definition NetUtils.h:22
UInt_64 channelId
Definition NetUtils.h:26
UInt_64 fragmentCount
Definition NetUtils.h:30
NetChannelType channelType
Definition NetUtils.h:27
Version channelVer
Definition NetUtils.h:28
bool ensure
Definition NetUtils.h:32
UInt_64 fragment
Definition NetUtils.h:31
UInt_64 opId
Definition NetUtils.h:35
Char_8 token[64]
Definition NetUtils.h:33
UInt_64 encId
Definition NetUtils.h:24
UInt_64 systemId
Definition NetUtils.h:34
Version version
Definition NetUtils.h:23
Version encVer
Definition NetUtils.h:25
Definition NetUtils.h:49
float lastResend
Definition NetUtils.h:52
Serializer< UInt_64 > payload
Definition NetUtils.h:51
Header header
Definition NetUtils.h:50
Definition NetUtils.h:43
Serializer< UInt_64 > payload
Definition NetUtils.h:45
Header header
Definition NetUtils.h:44