mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-08 08:46:04 +00:00
rework UDP recv loop, add packet statistics tracking
The UDPServerMain was badly designed and had multiple potential bugs and unexpected & silent failures. The changes simplify the code here, and tracks those unexpected failures in app-wide statistics. Also added, while at that, some more tracking of how many packets and bytes are sent & received per client
This commit is contained in:
@@ -87,6 +87,23 @@ public:
|
||||
void UpdatePingTime();
|
||||
int SecondsSinceLastPing();
|
||||
|
||||
// bytes received on UDP
|
||||
std::atomic_size_t UdpReceived = 0;
|
||||
// number of packets received on UDP
|
||||
std::atomic_size_t UdpPacketsReceived = 0;
|
||||
// bytes sent on UDP
|
||||
std::atomic_size_t UdpSent = 0;
|
||||
// number of packets sent on UDP
|
||||
std::atomic_size_t UdpPacketsSent = 0;
|
||||
|
||||
// bytes received on TCP
|
||||
std::atomic_size_t TcpReceived = 0;
|
||||
// bytes sent on TCP
|
||||
std::atomic_size_t TcpSent = 0;
|
||||
|
||||
std::chrono::high_resolution_clock::time_point ConnectionTime{};
|
||||
|
||||
|
||||
private:
|
||||
void InsertVehicle(int ID, const std::string& Data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user