[zeromq-dev] PHP Error on Ubuntu

lanre lawal lawillas4ever at yahoo.com
Wed Oct 12 00:24:36 CEST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111011/9ab29d1f/attachment.htm>


More information about the zeromq-dev mailing list