dongmi0760 2014-09-17 15:31
浏览 41
已采纳

PHP中的ZMQDevice

I'm trying to use $listener with IPC socket with ZMQDevice, but I receive nothing, if I switch to TCP, it works.

    ZMQDevice::__construct ( ZMQSocket $frontend, ZMQSocket $backend, ZMQSocket $listener)

pub.php

    $context = new ZMQContext();

    $frontend = new ZMQSocket($context, ZMQ::SOCKET_XXX);
    $frontend->bind("tcp://...");

    $backend = new ZMQSocket($context, ZMQ::SOCKET_XXX);
    $backend->bind("ipc://backend.ipc");

    $listener = new ZMQSocket($context, ZMQ::SOCKET_PUB);
    $listener->bind("ipc://witness.ipc");

    $device = new ZMQDevice($frontend, $backend, $listener);
    $device->run()

sub.php

    $context = new ZMQContext();

    $receiver = new ZMQSocket($context, ZMQ::SOCKET_SUB);
    $receiver->setSockOpt(ZMQ::SOCKOPT_SUBSCRIBE, '');
    $receiver->connect("ipc://witness.ipc");

Environment:

    libzmq1:amd64   2.2.0+dfsg-5
    zmq for PHP was installed with pecl

Any idea?

Thank you.

  • 写回答

1条回答 默认 最新

  • donjao6770 2014-09-18 12:27
    关注

    Sorry all, I found out why, I forgot that the device was executed in another directory.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 利用3支股票数据估计其均值和方差的95%置信区间。
  • ¥15 微信小程序运行一项功能时,弹出未知错误弹框,检查代码没有问题
  • ¥15 ATAC测序生成self-pseudo replicates之前是否要进行去线粒体reads
  • ¥15 python模糊字匹配函数问题
  • ¥20 谁刷目标页面的uv记录器上数据,数据只记录跳转的数值
  • ¥30 数据库软件的安装方法
  • ¥15 一道以太网数据传输题
  • ¥15 python 下载群辉文件
  • ¥50 代码还没怎么运行但是需要代码功能调用数据
  • ¥15 vue请求不到数据,返回状态200,数据为html