jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Libraries/] [MessageBus/] [ReactSocketPusher.php] - Rev 2

Compare with Previous - Blame - Download


<?php

namespace Phem\Libraries\MessageBus;

use Ratchet\WebSocket\Version\RFC6455\Message;

/**
 * @author Jakub PetrŞílka <petrzilka@czweb.net>
 */
class ReactSocketPusher extends Pusher
{

    public function push($message)
    {
        $fp = stream_socket_client(
                'tcp://' . WEBSOCKET_PULLER_BIND_ADDR
                . ':' . WEBSOCKET_PULLER_PORT, $errno, $errstr, 30);
        if ($fp)
        {
            fwrite($fp, json_encode($message));
            fclose($fp);
        }
    }

}

Powered by WebSVN 2.2.1