mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-21 15:14:36 +02:00
Short refactoring of UDP Receiver
This commit is contained in:
@@ -18,7 +18,7 @@ public:
|
||||
void bind(
|
||||
const uint16_t port,
|
||||
const size_t usec_timeout=core_buffer::BUFFER_UDP_US_TIMEOUT);
|
||||
void close();
|
||||
void disconnect();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "UdpReceiver.hpp"
|
||||
#include "jungfrau.hpp"
|
||||
#include "date.h"
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -13,7 +14,7 @@ UdpReceiver::UdpReceiver() :
|
||||
|
||||
UdpReceiver::~UdpReceiver()
|
||||
{
|
||||
close();
|
||||
disconnect();
|
||||
}
|
||||
|
||||
void UdpReceiver::bind(const uint16_t port, const size_t usec_timeout)
|
||||
@@ -90,8 +91,8 @@ bool UdpReceiver::receive(void* buffer, size_t buffer_n_bytes)
|
||||
return true;
|
||||
}
|
||||
|
||||
void UdpReceiver::close()
|
||||
void UdpReceiver::disconnect()
|
||||
{
|
||||
::close(socket_fd_);
|
||||
close(socket_fd_);
|
||||
socket_fd_ = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user