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
|
|
|
|
|
|
|
|
bool VerifyContext(void *ctx);
|
|
|
|
|
|
|
|
} // namespace UDPC
|
|
|
|
|
|
|
|
#endif
|