mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-05-02 15:41:40 +02: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)
|
inline bool send (message_t &msg_, int flags_ = 0)
|
||||||
{
|
{
|
||||||
int rc = zmq_send (ptr, &msg_, flags_);
|
int nbytes = zmq_sendmsg (ptr, &msg_, flags_);
|
||||||
if (rc == 0)
|
if (nbytes >= 0)
|
||||||
return true;
|
return true;
|
||||||
if (rc == -1 && zmq_errno () == EAGAIN)
|
if (zmq_errno () == EAGAIN)
|
||||||
return false;
|
return false;
|
||||||
throw error_t ();
|
throw error_t ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool recv (message_t *msg_, int flags_ = 0)
|
inline bool recv (message_t *msg_, int flags_ = 0)
|
||||||
{
|
{
|
||||||
int rc = zmq_recv (ptr, msg_, flags_);
|
int nbytes = zmq_recvmsg (ptr, msg_, flags_);
|
||||||
if (rc == 0)
|
if (nbytes >= 0)
|
||||||
return true;
|
return true;
|
||||||
if (rc == -1 && zmq_errno () == EAGAIN)
|
if (zmq_errno () == EAGAIN)
|
||||||
return false;
|
return false;
|
||||||
throw error_t ();
|
throw error_t ();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user