棘轮推送教程错误不能代表ZMQ_FD类型的流

时间:2016-02-25 22:21:38

标签: php websocket wamp zeromq ratchet

我试图在我的localhost上运行Ratchet教程应用程序。我按照本教程http://socketo.me/docs/push进行了操作,但是在我运行推送服务器(bin /push_server.php)之后,我在最后一步得到了这个错误

Warning: stream_select(): cannot represent a stream of type ZMQ_FD as a select()
able descriptor in C:\wamp\www\ratchet_podla_tutorialu\vendor\react\event-loop\S
treamSelectLoop.php on line 255

Call Stack:
    0.0010     236728   1. {main}() C:\wamp\www\ratchet_podla_tutorialu\bin\push
_server.php:0
    0.1950    1230808   2. React\EventLoop\StreamSelectLoop->run() C:\wamp\www\r
atchet_podla_tutorialu\bin\push_server.php:27
    0.1950    1231800   3. React\EventLoop\StreamSelectLoop->waitForStreamActivi
ty() C:\wamp\www\ratchet_podla_tutorialu\vendor\react\event-loop\StreamSelectLoo
p.php:201
    0.1950    1232352   4. React\EventLoop\StreamSelectLoop->streamSelect() C:\w
amp\www\ratchet_podla_tutorialu\vendor\react\event-loop\StreamSelectLoop.php:221

    0.1950    1232496   5. stream_select() C:\wamp\www\ratchet_podla_tutorialu\v
endor\react\event-loop\StreamSelectLoop.php:255

这是我的push_server.php文件:

<?php
    require dirname(__DIR__) . '/vendor/autoload.php';

    $loop   = React\EventLoop\Factory::create();
    $pusher = new MyApp\Pusher;

    // Listen for the web server to make a ZeroMQ push after an ajax request
    $context = new React\ZMQ\Context($loop);
    $pull = $context->getSocket(ZMQ::SOCKET_PULL);
    $pull->bind('tcp://127.0.0.1:5555'); // Binding to 127.0.0.1 means the only client that can connect is itself
    $pull->on('message', array($pusher, 'onBlogEntry'));

    // Set up our WebSocket server for clients wanting real-time updates
    $webSock = new React\Socket\Server($loop);
    $webSock->listen(8080, '0.0.0.0'); // Binding to 0.0.0.0 means remotes can connect
    $webServer = new Ratchet\Server\IoServer(
        new Ratchet\Http\HttpServer(
            new Ratchet\WebSocket\WsServer(
                new Ratchet\Wamp\WampServer(
                    $pusher
                )
            )
        ),
        $webSock
    );

    $loop->run();

我在Windows 7 x 64上运行WampServer x 64.

我在这里发现了一个较旧的帖子,那个家伙可能和我一样有问题,他通过安装WampServer x32版本修复了它。我想避免这个解决方案。有人知道如何解决它吗?

0 个答案:

没有答案