fix for changing udp socket buffer size

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

View File

@ -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(

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));