Created
August 18, 2016 11:19
-
-
Save harveyslash/428fafef7679ecf0522b2748cbb0f7ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function startWampServer() | |
{ | |
$loop = \React\EventLoop\Factory::create(); | |
// $class = $this->option('class'); | |
// $ratchetServer = new $class($this); | |
// $this->info(sprintf('Starting ZMQ server on: %s:%s', config('ratchet.zmq.host'), config('ratchet.zmq.port'))); | |
// $context = new \React\ZMQ\Context($loop); | |
// $pull = $context->getSocket(\ZMQ::SOCKET_PULL); | |
// $pull->bind(sprintf('tcp://%s:%d', config('ratchet.zmq.host'), config('ratchet.zmq.port'))); | |
// | |
// $pull->on('message', function($message) use ($ratchetServer) { | |
// $ratchetServer->onEntry($message); | |
// }); | |
$webSock = new \React\Socket\Server($loop); | |
$webSock->listen($this->port, $this->host); | |
$webServer = new \Ratchet\Server\IoServer( | |
new \Ratchet\Http\HttpServer( | |
new \Ratchet\WebSocket\WsServer( | |
new PusherServer() | |
) | |
), | |
$webSock | |
); | |
return $loop; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment