[zeromq-dev] PHP Error on Ubuntu
Amr Ali
amr.ali.cc at gmail.com
Wed Oct 12 00:48:55 CEST 2011
I'm not familiar with the PHP client library but this error basically says that
the send() operation has not been completed, and since this is a REQ socket, you
cannot recv() before you send().
I'd make sure that send() was successful first (lookup documentation to see how
to check on that) and you should do the same for recv() as well.
On 10/12/2011 12:24 AM, lanre lawal wrote:
> So guys haven been frustrated by the windows build process, i decided to install
> Ubuntu on my work station and as you all rightly noted, the installation process
> for ZMQ was pretty straight forward. However the extension has been loaded
> correctly and appears in the phpinfo() page. Now i tried to run a test code to
> connect to a remote address that is currently sending some messages so that I
> could receive the messages but i got this error in my code. I¨m using the PHP
> binding. Below is my code and the error i got.
>
> CODE
> <?php
> $queue = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REQ, "Sock1");
> $queue->connect("tcp://24.187.208.22:2060");
> var_dump($queue->send("Hello there!")->recv());
> ?>
>
> ERROR
> Fatal error: Uncaught exception 'ZMQSocketException' with message 'Failed to
> receive message: Operation cannot be accomplished in current state' in
> /home/lax/www/liverycompass/index.php:4 Stack trace: #0
> /home/lax/www/liverycompass/index.php(4): ZMQSocket->recv() #1 {main} thrown in
> /home/lax/www/liverycompass/index.php on line 4
>
> Please what could be the problem. Thanks guys for your help so far
>
> Regards,
> Olanrewaju Lawal
> Web Developer / Programmer
> +2348053568948
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111012/00aab346/attachment.sig>
More information about the zeromq-dev
mailing list