From 1dc95b4eed7974549ef43a87e0777aa343b30fd4 Mon Sep 17 00:00:00 2001 From: Tobias Frust Date: Wed, 29 Jun 2016 21:44:58 +0200 Subject: added client and server executable for testing simple udp packet transfer --- src/UDPServer/UDPServer.cpp | 10 ++++++++++ src/UDPServer/UDPServer.h | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/UDPServer') diff --git a/src/UDPServer/UDPServer.cpp b/src/UDPServer/UDPServer.cpp index cd36647..854835a 100644 --- a/src/UDPServer/UDPServer.cpp +++ b/src/UDPServer/UDPServer.cpp @@ -41,6 +41,16 @@ * \param[in] addr The address we receive on. * \param[in] port The port we receive from. */ + +#include "UDPServer.h" + + #include + #include + + #ifndef SOCK_CLOEXEC + #define SOCK_CLOEXEC 0 + #endif + UDPServer::UDPServer(const std::string& addr, int port) : f_port(port) , f_addr(addr) diff --git a/src/UDPServer/UDPServer.h b/src/UDPServer/UDPServer.h index 7eef796..22f33b3 100644 --- a/src/UDPServer/UDPServer.h +++ b/src/UDPServer/UDPServer.h @@ -14,7 +14,13 @@ #include #include #include -#include +#include + +class udp_client_server_runtime_error : public std::runtime_error +{ +public: + udp_client_server_runtime_error(const char *w) : std::runtime_error(w) {} +}; class UDPServer { -- cgit v1.2.3