summaryrefslogtreecommitdiffstats
path: root/src/UDPServer/UDPServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/UDPServer/UDPServer.cpp')
-rw-r--r--src/UDPServer/UDPServer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/UDPServer/UDPServer.cpp b/src/UDPServer/UDPServer.cpp
index 8c9decf..42166b4 100644
--- a/src/UDPServer/UDPServer.cpp
+++ b/src/UDPServer/UDPServer.cpp
@@ -81,6 +81,13 @@ UDPServer::UDPServer(const std::string& addr, int port)
close(f_socket);
throw udp_client_server_runtime_error(("could not bind UDP socket with: \"" + addr + ":" + decimal_port + "\"").c_str());
}
+
+/*
+ int a = 134217728;
+ if (setsockopt(f_socket, SOL_SOCKET, SO_RCVBUF, &a, sizeof(int)) == -1) {
+ fprintf(stderr, "Error setting socket opts: %s\n", strerror(errno));
+ }
+*/
}
/** \brief Clean up the UDP server.
@@ -184,3 +191,12 @@ int UDPServer::timed_recv(char *msg, size_t max_size, int max_wait_s)
// our socket has data
return ::recv(f_socket, msg, max_size, 0);
}
+
+int UDPServer::mrecv(int n, struct mmsghdr *msg, int max_wait_s)
+{
+ struct timespec timeout;
+ timeout.tv_sec = max_wait_s;
+ timeout.tv_nsec = 0;
+
+ return recvmmsg(f_socket, msg, n, MSG_WAITFORONE, &timeout);
+}