mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-01 07:42:22 +02:00
Add disconnect function to ZmqReceiver
This commit is contained in:
@@ -62,6 +62,8 @@ class ZmqReceiver
|
||||
|
||||
void connect();
|
||||
|
||||
void disconnect();
|
||||
|
||||
std::shared_ptr<FrameMetadata> read_json_header(const std::string& header);
|
||||
|
||||
std::pair<std::shared_ptr<FrameMetadata>, char*> receive();
|
||||
|
||||
@@ -96,6 +96,20 @@ void ZmqReceiver::connect()
|
||||
receiver->connect(connect_address);
|
||||
}
|
||||
|
||||
void ZmqReceiver::disconnect()
|
||||
{
|
||||
#ifdef DEBUG_OUTPUT
|
||||
using namespace date;
|
||||
using namespace chrono;
|
||||
cout << "[" << system_clock::now() << "]";
|
||||
cout << "[ZmqReceiver::disconnect]";
|
||||
cout << " Disconnect." << endl;
|
||||
#endif
|
||||
|
||||
receiver->disconnect(connect_address);
|
||||
context->close();
|
||||
}
|
||||
|
||||
pair<shared_ptr<FrameMetadata>, char*> ZmqReceiver::receive()
|
||||
{
|
||||
if (!receiver) {
|
||||
|
||||
Reference in New Issue
Block a user