From 3a231f12b8311ae8c1e98374d295ce37d5043128 Mon Sep 17 00:00:00 2001 From: Ding Li Date: Fri, 26 May 2017 14:09:57 +0800 Subject: [PATCH] Fix send recv method return value check bug --- Include/Zmq/Socket.mqh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Include/Zmq/Socket.mqh b/Include/Zmq/Socket.mqh index ba90c4e..47898fe 100644 --- a/Include/Zmq/Socket.mqh +++ b/Include/Zmq/Socket.mqh @@ -187,7 +187,7 @@ bool Socket::recv(uchar &buf[],bool nowait=false) { int options=0; if(nowait) options|=ZMQ_DONTWAIT; - return 0==zmq_recv(m_ref,buf,ArraySize(buf),options); + return -1!=zmq_recv(m_ref,buf,ArraySize(buf),options); } //+------------------------------------------------------------------+ //| | @@ -197,7 +197,7 @@ bool Socket::send(const uchar &buf[],bool nowait=false,bool more=false) int options=0; if(nowait) options|=ZMQ_DONTWAIT; if(more) options|=ZMQ_SNDMORE; - return 0==zmq_send(m_ref,buf,ArraySize(buf),options); + return -1!=zmq_send(m_ref,buf,ArraySize(buf),options); } //+------------------------------------------------------------------+ //| | @@ -207,7 +207,7 @@ bool Socket::sendConst(const uchar &buf[],bool nowait=false,bool more=false) int options=0; if(nowait) options|=ZMQ_DONTWAIT; if(more) options|=ZMQ_SNDMORE; - return 0==zmq_send_const(m_ref,buf,ArraySize(buf),options); + return -1!=zmq_send_const(m_ref,buf,ArraySize(buf),options); } //+------------------------------------------------------------------+ //| Send a zmq_msg_t through a socket |