[zeromq-dev] Request Reply pattern

Marlborough, Rick RMarlborough at aaccorp.com
Wed May 3 21:00:42 CEST 2017


Designation: Non-Export Controlled Content
Folks;
                We have test software that is testing the request reply pattern. We are doing failure testing. The failure testing involves killing and restarting the server. We have code in the requester that "attempts" to do a reconnect to the server. However, after the reconnect, the subsequent send calls always fail and ZeroMQ reports "Operation cannot be accomplished in current state". Is there a way to "reset" a request socket and clear this condition?

Thanks
Rick

From: zeromq-dev [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Max Kozlovsky
Sent: Wednesday, May 03, 2017 2:39 PM
To: ZeroMQ development list
Subject: Re: [zeromq-dev] Dipping into zmq_recv from czmq

Hi,

zmsg_ function can be used to send/receive any kind of data in czmq.

http://czmq.zeromq.org/czmq4-0:zmsg<https://urldefense.proofpoint.com/v2/url?u=http-3A__czmq.zeromq.org_czmq4-2D0-3Azmsg&d=DwMFaQ&c=L6cnQwNGJqqFwLSmuJQH9Q&r=0vkEC-wQCdHs6_7-T7j4hT5guWBPAv8lluqeyT5n0ww&m=ybwlhjaNwigPf6--TDOq_K-NsppUGJ8ocVKZjKjfcck&s=2QpB4zkh8XhXQD0-A9ps4wd-R517crDYQnX78nhLxLc&e=>

Max

On Wed, May 3, 2017 at 8:53 AM, Brian Sellden <brian_ls2 at comcast.net<mailto:brian_ls2 at comcast.net>> wrote:
Hello,

I'm using czmq to transfer serialized objects in char arrays.  The serialized data may contain nulls, so processing with c-string oriented functions Is a problem.  So using zstr_recv(void*) doesn't work for me as it returns a char* with no way to identify the length of the array.

I thought I might dip into the zmq calls directly so I can use zmq_recv(void* source, void* buf, size_t len, int flags), as it returns the number of bytes copied into the buffer.  But my sockets are created with zsock_new(...), so I'm not sure about the compatibility of these calls.  Am I on the right track with this, and can someone offer some advice on how to proceed?  I did try just putting my zsock_t* into the zmq_recv call, but it just returns -1 even though zpoller_t reports that there is data available on the socket.

Thanks -

Brian.

_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org<mailto:zeromq-dev at lists.zeromq.org>
https://lists.zeromq.org/mailman/listinfo/zeromq-dev<https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.zeromq.org_mailman_listinfo_zeromq-2Ddev&d=DwMFaQ&c=L6cnQwNGJqqFwLSmuJQH9Q&r=0vkEC-wQCdHs6_7-T7j4hT5guWBPAv8lluqeyT5n0ww&m=ybwlhjaNwigPf6--TDOq_K-NsppUGJ8ocVKZjKjfcck&s=jcAEmIJGC3YZwlaGXkD1jwZPRFM9yTzkzLCZSiQuNpI&e=>


3.1.1001
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170503/59bc8dbe/attachment.htm>


More information about the zeromq-dev mailing list