summaryrefslogtreecommitdiffstats
path: root/src/main_server.cpp
diff options
context:
space:
mode:
authorTobias Frust <tobiasfrust@gmail.com>2016-07-11 14:58:00 +0200
committerTobias Frust <tobiasfrust@gmail.com>2016-07-11 14:58:00 +0200
commitd71e5fe7330fa51cdce466ec0df876eb9b8e721e (patch)
tree35642a156031e14aae504ecee46dea74558597a4 /src/main_server.cpp
parent0c33319451deec9b5461b57856423bc619817245 (diff)
downloadods-d71e5fe7330fa51cdce466ec0df876eb9b8e721e.tar.gz
ods-d71e5fe7330fa51cdce466ec0df876eb9b8e721e.tar.bz2
ods-d71e5fe7330fa51cdce466ec0df876eb9b8e721e.tar.xz
ods-d71e5fe7330fa51cdce466ec0df876eb9b8e721e.zip
UDP packets are sent out correctly
Diffstat (limited to 'src/main_server.cpp')
-rw-r--r--src/main_server.cpp6
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;
}