fix for changing udp socket buffer size

This commit is contained in:
2022-12-05 13:17:16 +01:00
parent 4caf10c12b
commit b089dc90cd
2 changed files with 3 additions and 2 deletions

View File

@ -205,6 +205,8 @@ void Listener::CreateDummySocketForUDPSocketBufferSize(int s, int &actualSize) {
// create dummy socket
try {
// to allowe ports to be bound from udpsocket
udpSocket.reset();
UdpRxSocket g(
udpPortNumber, packetSize,
(eth.length() ? InterfaceNameToIp(eth).str().c_str() : nullptr),
@ -218,7 +220,7 @@ void Listener::CreateDummySocketForUDPSocketBufferSize(int s, int &actualSize) {
} else {
generalData->udpSocketBufferSize = actualSize / 2;
}
// to allow udp sockets to be able to bind in the future
} catch (...) {
throw RuntimeError("Could not create a test UDP socket on port " +
std::to_string(udpPortNumber));