[zeromq-dev] Newbie Question: php-zmq and the "Divide and Conquer" Example - "Failed to bind the ZMQ: Address already in use"

Jonathan Rockway jon at jrock.us
Wed Jan 5 14:32:21 CET 2011


* On Tue, Jan 04 2011, Kermode Bear wrote:
> ventilator.php:
> <?php
> $context = new ZMQContext();
> $sender  = new ZMQSocket($context, ZMQ::SOCKET_PUSH);
> $sender->bind('tcp://*:5557');
> $sender->send('This is a test message.');
> ?>
>
> worker.php:
> <?php
> $context = new ZMQContext();
> $recv    = new ZMQSocket($context, ZMQ::SOCKET_PULL);
> $recv->bind('tcp://localhost:5557');
> var_dump($recv->recv());
> ?>
>
> Start the ventilator process, then start the worker process to see things explode.

Should you be binding 5557 in both apps, or should one bind and the
other connect?

--
print just => another => perl => hacker => if $,=$"



More information about the zeromq-dev mailing list