| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <enet/enet.h> |
| 7 |
#include <utility> |
| 8 |
|
| 9 |
namespace Common |
| 10 |
{ |
| 11 |
class QoSSession |
| 12 |
{ |
| 13 |
public: |
| 14 |
|
| 15 |
|
| 16 |
static constexpr int ef_tos = 0b10111000; |
| 17 |
|
| 18 |
QoSSession() = default; |
| 19 |
QoSSession(ENetPeer* peer, int tos_val = ef_tos); |
| 20 |
|
| 21 |
~QoSSession(); |
| 22 |
|
| 23 |
QoSSession& operator=(const QoSSession&) = delete; |
| 24 |
QoSSession(const QoSSession&) = delete; |
| 25 |
|
| 26 |
QoSSession& operator=(QoSSession&& session); |
| 27 |
QoSSession(QoSSession&& session) { *this = std::move(session); } |
| 28 |
bool Successful() const { return m_success; } |
| 29 |
|
| 30 |
private: |
| 31 |
#if defined(_WIN32) |
| 32 |
void* m_qos_handle = nullptr; |
| 33 |
unsigned long m_qos_flow_id = 0; |
| 34 |
|
| 35 |
ENetPeer* m_peer = nullptr; |
| 36 |
#endif |
| 37 |
|
| 38 |
bool m_success = false; |
| 39 |
}; |
| 40 |
} |