diff options
author | Tobias Frust <tobiasfrust@Tobiass-MacBook-Pro.fritz.box> | 2016-06-29 21:44:58 +0200 |
---|---|---|
committer | Tobias Frust <tobiasfrust@Tobiass-MacBook-Pro.fritz.box> | 2016-06-29 21:44:58 +0200 |
commit | 1dc95b4eed7974549ef43a87e0777aa343b30fd4 (patch) | |
tree | c61eaa825e4b873354318f1fdc776fa53b2d303e /src/main_server.cpp | |
parent | 38b0d8ad024d11fa643934b0c56690b0e57c3e35 (diff) | |
download | ods-1dc95b4eed7974549ef43a87e0777aa343b30fd4.tar.gz ods-1dc95b4eed7974549ef43a87e0777aa343b30fd4.tar.bz2 ods-1dc95b4eed7974549ef43a87e0777aa343b30fd4.tar.xz ods-1dc95b4eed7974549ef43a87e0777aa343b30fd4.zip |
added client and server executable for testing simple udp packet transfer
Diffstat (limited to 'src/main_server.cpp')
-rw-r--r-- | src/main_server.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main_server.cpp b/src/main_server.cpp new file mode 100644 index 0000000..b90de52 --- /dev/null +++ b/src/main_server.cpp @@ -0,0 +1,28 @@ +#include "UDPServer/UDPServer.h" + +#include <iostream> +#include <string> + +int main (int argc, char *argv[]){ + + std::cout << "Receiving UDP packages: " << std::endl; + + std::string address = "localhost"; + int port = 1234; + + UDPServer server = UDPServer(address, port); + + std::size_t length{8000}; + + char buf[length]; + + server.recv(buf, length); + + for(auto i = 0; i < length; i++){ + printf("%c", buf[i]); + } + printf("\n"); + + return 0; + +} |