mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-12 10:33:52 +01:00
Update to 3.0 API
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
parent
38bbe08168
commit
9da2598aa0
12
zmq.hpp
12
zmq.hpp
@ -270,20 +270,20 @@ namespace zmq
|
||||
|
||||
inline bool send (message_t &msg_, int flags_ = 0)
|
||||
{
|
||||
int rc = zmq_send (ptr, &msg_, flags_);
|
||||
if (rc == 0)
|
||||
int nbytes = zmq_sendmsg (ptr, &msg_, flags_);
|
||||
if (nbytes >= 0)
|
||||
return true;
|
||||
if (rc == -1 && zmq_errno () == EAGAIN)
|
||||
if (zmq_errno () == EAGAIN)
|
||||
return false;
|
||||
throw error_t ();
|
||||
}
|
||||
|
||||
inline bool recv (message_t *msg_, int flags_ = 0)
|
||||
{
|
||||
int rc = zmq_recv (ptr, msg_, flags_);
|
||||
if (rc == 0)
|
||||
int nbytes = zmq_recvmsg (ptr, msg_, flags_);
|
||||
if (nbytes >= 0)
|
||||
return true;
|
||||
if (rc == -1 && zmq_errno () == EAGAIN)
|
||||
if (zmq_errno () == EAGAIN)
|
||||
return false;
|
||||
throw error_t ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user