Skip to content

Commit

Permalink
Merge pull request #272 from odin-detector/217_fr_recvbuf
Browse files Browse the repository at this point in the history
Restore set/get of SO_RCVBUF socket option in frame receiver UDP RX thread
  • Loading branch information
timcnicholls authored Mar 19, 2021
2 parents a036e6f + a6cb3c6 commit 7a03f48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frameReceiver/src/FrameReceiverUDPRxThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void FrameReceiverUDPRxThread::run_specific_service(void)
}

// Set the socket receive buffer size
if (setsockopt(recv_socket, SOL_SOCKET, SO_REUSEADDR, &config_.rx_recv_buffer_size_, sizeof(config_.rx_recv_buffer_size_)) < 0)
if (setsockopt(recv_socket, SOL_SOCKET, SO_RCVBUF, &config_.rx_recv_buffer_size_, sizeof(config_.rx_recv_buffer_size_)) < 0)
{
std::stringstream ss;
ss << "RX channel failed to set receive socket buffer size for port " << rx_port << " : " << strerror(errno);
Expand All @@ -60,8 +60,8 @@ void FrameReceiverUDPRxThread::run_specific_service(void)
// Read it back and display
int buffer_size;
socklen_t len = sizeof(buffer_size);
getsockopt(recv_socket, SOL_SOCKET, SO_REUSEADDR, &buffer_size, &len);
LOG4CXX_DEBUG_LEVEL(1, logger_, "RX thread receive buffer size for port " << rx_port << " is " << buffer_size);
getsockopt(recv_socket, SOL_SOCKET, SO_RCVBUF, &buffer_size, &len);
LOG4CXX_DEBUG_LEVEL(1, logger_, "RX thread receive buffer size for port " << rx_port << " is " << buffer_size / 2);

// Bind the socket to the specified port
struct sockaddr_in recv_addr;
Expand Down

0 comments on commit 7a03f48

Please sign in to comment.