2019-06-06 07:02:48 +00:00
|
|
|
#ifndef UDPC_DEFINES_HPP
|
|
|
|
#define UDPC_DEFINES_HPP
|
|
|
|
|
|
|
|
#define UDPC_CONTEXT_IDENTIFIER 0x902F4DB3
|
|
|
|
|
|
|
|
#include <atomic>
|
2019-06-06 07:42:07 +00:00
|
|
|
#include <bitset>
|
|
|
|
#include <cstdint>
|
2019-06-06 07:02:48 +00:00
|
|
|
|
|
|
|
#include "UDPConnection.h"
|
|
|
|
|
|
|
|
namespace UDPC {
|
|
|
|
|
|
|
|
struct Context {
|
|
|
|
Context(bool isThreaded);
|
|
|
|
|
|
|
|
uint_fast32_t _contextIdentifier;
|
|
|
|
/*
|
|
|
|
* 0 - isThreaded
|
|
|
|
*/
|
|
|
|
std::bitset<32> flags;
|
|
|
|
std::atomic_bool isAcceptNewConnections;
|
|
|
|
std::atomic_uint32_t protocolID;
|
|
|
|
std::atomic_uint_fast8_t loggingType;
|
|
|
|
char atostrBuf[16];
|
|
|
|
}; // struct Context
|
|
|
|
|
2019-07-21 04:45:42 +00:00
|
|
|
Context* verifyContext(void *ctx);
|
2019-06-06 07:02:48 +00:00
|
|
|
|
2019-07-07 05:44:37 +00:00
|
|
|
bool isBigEndian();
|
|
|
|
|
2019-06-06 07:02:48 +00:00
|
|
|
} // namespace UDPC
|
|
|
|
|
|
|
|
#endif
|