本文整理汇总了PHP中ZMQSocket::disconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP ZMQSocket::disconnect方法的具体用法?PHP ZMQSocket::disconnect怎么用?PHP ZMQSocket::disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZMQSocket
的用法示例。
在下文中一共展示了ZMQSocket::disconnect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: close
/**
* {@inheritdoc}
*/
public function close()
{
if ($this->socket instanceof \ZMQSocket && !$this->socket->isPersistent()) {
$this->socket->disconnect($this->dsn);
}
$this->socket = null;
}
示例2: it_sends_message_and_gets_response
/**
* @test
*/
public function it_sends_message_and_gets_response()
{
$socket = new \ZMQSocket(new \ZMQContext(), \ZMQ::SOCKET_REQ);
$zmqClient = new ZeroMQSocket($socket, 'tcp://localhost:5556');
$zmqClient->send($message = 'testing-123');
$this->assertEquals($message, $zmqClient->receive());
$socket->disconnect('tcp://localhost:5556');
}
示例3: setupPushSocket
protected function setupPushSocket($queueId)
{
$connect = true;
if (!empty($this->push)) {
$endpoints = $this->push->getendpoints();
if (!empty($endpoints["connect"][0]) && $endpoints["connect"][0] != $queueId) {
$this->push->disconnect($endpoints["connect"][0]);
} else {
$connect = false;
}
} else {
$this->push = $this->socketFactory->createPushSocket();
}
if ($connect) {
$this->push->connect($queueId);
}
}