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 <nmit...@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 <m...@simplicidade.org> wrote:
>>
>> Hi,
>>
>>
>> On 27/12/2012, at 20:46, Nishant Mittal <nmit...@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@lists.zeromq.org
>> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev@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@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to