diff options
Diffstat (limited to 'src/main_server.cpp')
-rw-r--r-- | src/main_server.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main_server.cpp b/src/main_server.cpp index a645f49..6e936e4 100644 --- a/src/main_server.cpp +++ b/src/main_server.cpp @@ -35,6 +35,7 @@ int main (int argc, char *argv[]){ UDPServer server = UDPServer(address, port); std::size_t length{32768}; + std::size_t lastIndex{0}; std::vector<unsigned short> buf(16000); @@ -52,6 +53,11 @@ int main (int argc, char *argv[]){ std::size_t index = *((std::size_t *)buf.data()); if(index%1000 == 99) printf("%lu\n", index); + if(lastIndex != (index-1)) + BOOST_LOG_TRIVIAL(warning) << "Packet loss or wrong order!"; + + lastIndex = index; + BOOST_LOG_TRIVIAL(debug) << "Server: Received " << bytes << " Bytes with Index " << index; } |