From b089dc90cd9240116da3889486f6f7fc369f6946 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 5 Dec 2022 13:17:16 +0100 Subject: [PATCH] fix for changing udp socket buffer size --- slsDetectorSoftware/tests/test-CmdProxy-rx.cpp | 1 - slsReceiverSoftware/src/Listener.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp b/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp index 1f4b7e8fa..ce642829e 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-rx.cpp @@ -342,7 +342,6 @@ TEST_CASE("rx_padding", "[.cmd][.rx]") { } TEST_CASE("rx_udpsocksize", "[.cmd][.rx]") { - //exit(-1); Detector det; CmdProxy proxy(&det); int64_t prev_val = det.getRxUDPSocketBufferSize().tsquash( diff --git a/slsReceiverSoftware/src/Listener.cpp b/slsReceiverSoftware/src/Listener.cpp index 1c970e21e..68ac3ca50 100644 --- a/slsReceiverSoftware/src/Listener.cpp +++ b/slsReceiverSoftware/src/Listener.cpp @@ -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));