commit
This commit is contained in:
parent
b42d6d3975
commit
6a45296154
|
|
@ -44,20 +44,15 @@ class StartWebSocketServer extends Command
|
||||||
|
|
||||||
protected function startWebSocketServer()
|
protected function startWebSocketServer()
|
||||||
{
|
{
|
||||||
|
$this->info("Starting the WebSocket server on port {$this->option('port')}...");
|
||||||
|
|
||||||
$routes = WebSocketRouter::getRoutes();
|
$routes = WebSocketRouter::getRoutes();
|
||||||
|
|
||||||
$loop = LoopFactory::create();
|
|
||||||
|
|
||||||
$loop->futureTick(function () {
|
|
||||||
$this->info("Started the WebSocket server on port {$this->option('port')}");
|
|
||||||
});
|
|
||||||
|
|
||||||
/** 🎩 Start the magic 🎩 */
|
/** 🎩 Start the magic 🎩 */
|
||||||
return (new WebSocketServer($routes))
|
return (new WebSocketServer($routes))
|
||||||
->setHost($this->option('host'))
|
->setHost($this->option('host'))
|
||||||
->setPort($this->option('port'))
|
->setPort($this->option('port'))
|
||||||
->setConsoleOutput($this->output)
|
->setConsoleOutput($this->output)
|
||||||
->setLoop($loop)
|
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue