[zeromq-dev] Multipart msgs and Perl

Nishant Mittal nmittal at rblt.com
Fri Dec 28 03:39:49 CET 2012


that did it. thanks

I now have a working "Asynchronous Client-Server pattern" with clients and
workers in Perl and the intermediary device in C.

thanks again
Nishant


On Thu, Dec 27, 2012 at 7:27 PM, Daisuke Maki <lestrrat at gmail.com> wrote:

> Ah, I see you looked at the SYNOPSIS only, and didn't read the rest of the
> docs.
> The SYNOPSIS was a copy from LibZMQ2, so it was wrong:
>
>    zmq_send($socket, $msg, $flags);
>
> Should read
>
>    zmq_send($socket, $buffer, $size, $flags);
>
> So your client.pl is actually doing
>
>    zmq_send($socket, "your message", ZMQ_SNDMORE);
>    # which means, "send the first two byts of your message"
>
> zeromq2.x had the former semantics, zeromq3.x has the latter. And your
> example would work if you just change zmq_send to zmq_sendmsg, albeit
> you have zero error detection and you don't check for
> zmq_getsockopt($socket, ZMQ_RCVMORE), which zmq_recvmsg (3) clearly
> states.
>
> --d
>
> 2012/12/28 Nishant Mittal <nmittal at rblt.com>:
> > Michael/Pedro,
> >
> > I uploaded my worker and client code on https://gist.github.com/4392186
> >
> > client sends a message with 2 parts and then expects a response. worker
> > expected 2 part message and then sends a response.
> >
> > I get an error on line #21 "Argument is not an object" in worker.
> >
> > thanks for your help
> > Nishant
> >
> >
> > On Thu, Dec 27, 2012 at 4:29 PM, Pedro Melo <melo at simplicidade.org>
> wrote:
> >>
> >> Hi,
> >>
> >>
> >> On 27/12/2012, at 20:46, Nishant Mittal <nmittal at rblt.com> wrote:
> >>
> >> > Has anyone been able to make multipart msgs work with Perl? could you
> >> > point me to documentation online or better code?
> >>
> >> Sure, works fine. Just make sure you are using the ZMQ::LibZMQ3
> bindings,
> >> those are the most up-to-date and stable.
> >>
> >> Bye,
> >>
> >>
> >> >
> >> >
> >> > _______________________________________________
> >> > zeromq-dev mailing list
> >> > zeromq-dev at lists.zeromq.org
> >> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> zeromq-dev at lists.zeromq.org
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> >
> >
> >
> > --
> > Nishant Mittal
> > Director, Product Development
> > Rosenblatt Securities Inc.
> > 20 Broad Street
> > New York, NY 10005
> >
> > Direct: 212-607-3159
> > Mobile: 646-504-2629
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



-- 
*Nishant Mittal*
Director, Product Development
*Rosenblatt Securities Inc*.
20 Broad Street
New York, NY 10005

Direct: 212-607-3159
Mobile: 646-504-2629
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121227/00e49498/attachment.htm>


More information about the zeromq-dev mailing list