mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Add API to extract ZMQ_EVENTS from socket backend
This commit is contained in:
committed by
Alexey Rybalchenko
parent
d5d5c27958
commit
e8cc104344
@@ -375,6 +375,15 @@ class Socket final : public fair::mq::Socket
|
||||
}
|
||||
}
|
||||
|
||||
void Events(uint32_t* events) override
|
||||
{
|
||||
size_t eventsSize = sizeof(uint32_t);
|
||||
if (zmq_getsockopt(fSocket, ZMQ_EVENTS, events, &eventsSize) < 0) {
|
||||
throw SocketError(
|
||||
tools::ToString("failed setting ZMQ_EVENTS, reason: ", zmq_strerror(errno)));
|
||||
}
|
||||
}
|
||||
|
||||
int GetLinger() const override
|
||||
{
|
||||
int value = 0;
|
||||
@@ -485,6 +494,12 @@ class Socket final : public fair::mq::Socket
|
||||
if (constant == "snd-more no-block") return ZMQ_DONTWAIT|ZMQ_SNDMORE;
|
||||
|
||||
if (constant == "fd") return ZMQ_FD;
|
||||
if (constant == "events")
|
||||
return ZMQ_EVENTS;
|
||||
if (constant == "pollin")
|
||||
return ZMQ_POLLIN;
|
||||
if (constant == "pollout")
|
||||
return ZMQ_POLLOUT;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user