mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-16 16:13:58 +00:00
zmq_errno used in C++ binding
This commit is contained in:
parent
95329719cd
commit
551fa104ff
@ -23,7 +23,6 @@
|
|||||||
#include "zmq.h"
|
#include "zmq.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ namespace zmq
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
error_t () : errnum (errno) {}
|
error_t () : errnum (zmq_errno ()) {}
|
||||||
|
|
||||||
virtual const char *what () const throw ()
|
virtual const char *what () const throw ()
|
||||||
{
|
{
|
||||||
@ -232,7 +231,7 @@ namespace zmq
|
|||||||
int rc = zmq_send (ptr, &msg_, flags_);
|
int rc = zmq_send (ptr, &msg_, flags_);
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
return true;
|
return true;
|
||||||
if (rc == -1 && errno == EAGAIN)
|
if (rc == -1 && zmq_errno () == EAGAIN)
|
||||||
return false;
|
return false;
|
||||||
throw error_t ();
|
throw error_t ();
|
||||||
}
|
}
|
||||||
@ -249,7 +248,7 @@ namespace zmq
|
|||||||
int rc = zmq_recv (ptr, msg_, flags_);
|
int rc = zmq_recv (ptr, msg_, flags_);
|
||||||
if (rc == 0)
|
if (rc == 0)
|
||||||
return true;
|
return true;
|
||||||
if (rc == -1 && errno == EAGAIN)
|
if (rc == -1 && zmq_errno () == EAGAIN)
|
||||||
return false;
|
return false;
|
||||||
throw error_t ();
|
throw error_t ();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user