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 \Ratchet\Wamp\WampServer($ratchetServer))), $webSock);
return $loop;
}