mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Improve Events API
If the call is interrupted by a signal, this will throw, which we clearly do not want. Simplifying the API to let the user decide what to do on error is probably the best option.
This commit is contained in:
committed by
Dennis Klein
parent
868fe02ee9
commit
6dfea32aee
@@ -378,12 +378,10 @@ class Socket final : public fair::mq::Socket
|
||||
}
|
||||
}
|
||||
|
||||
void Events(uint32_t* events) override
|
||||
int 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)));
|
||||
}
|
||||
return zmq_getsockopt(fSocket, ZMQ_EVENTS, events, &eventsSize);
|
||||
}
|
||||
|
||||
int GetLinger() const override
|
||||
|
Reference in New Issue
Block a user