php zero mq

435 ワード

詳細
PHP Zero MQ
 
use ZMQ;
use ZMQContext;
use ZMQSocket;

$addr = "tcp://127.0.0.1:5555";

$context = new ZMQContext();     
$socket  = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$socket->connect($addr);
$socket->send("hello , this is a messgae");
$reply = $socket->recv();
$socket->disconnect($addr);