Merge pull request #810 from ratchetphp/fix-786

App should accept Ws MCI
This commit is contained in:
Chris Boden 2020-06-04 09:57:01 -04:00 committed by GitHub
commit 9ce2a127be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ use Ratchet\Server\IoServer;
use Ratchet\Server\FlashPolicy; use Ratchet\Server\FlashPolicy;
use Ratchet\Http\HttpServer; use Ratchet\Http\HttpServer;
use Ratchet\Http\Router; use Ratchet\Http\Router;
use Ratchet\WebSocket\MessageComponentInterface as WsMessageComponentInterface;
use Ratchet\WebSocket\WsServer; use Ratchet\WebSocket\WsServer;
use Ratchet\Wamp\WampServer; use Ratchet\Wamp\WampServer;
use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\RouteCollection;
@ -105,7 +106,7 @@ class App {
} elseif ($controller instanceof WampServerInterface) { } elseif ($controller instanceof WampServerInterface) {
$decorated = new WsServer(new WampServer($controller)); $decorated = new WsServer(new WampServer($controller));
$decorated->enableKeepAlive($this->_server->loop); $decorated->enableKeepAlive($this->_server->loop);
} elseif ($controller instanceof MessageComponentInterface) { } elseif ($controller instanceof MessageComponentInterface || $controller instanceof WsMessageComponentInterface) {
$decorated = new WsServer($controller); $decorated = new WsServer($controller);
$decorated->enableKeepAlive($this->_server->loop); $decorated->enableKeepAlive($this->_server->loop);
} else { } else {