Merge branch '0.4-pong' into 0.4

This commit is contained in:
Chris Boden 2016-06-06 09:13:02 -04:00
commit a78c8d2ddf
2 changed files with 9 additions and 2 deletions

View File

@ -192,7 +192,7 @@ class WsServer implements HttpServerInterface {
}
public function enableKeepAlive(LoopInterface $loop, $interval = 30) {
$lastPing = null;
$lastPing = new Frame(uniqid(), true, Frame::OP_PING);
$pingedConnections = new \SplObjectStorage;
$splClearer = new \SplObjectStorage;

View File

@ -23,7 +23,14 @@ class BinaryEcho implements \Ratchet\WebSocket\MessageComponentInterface {
$loop = new $impl;
$sock = new React\Socket\Server($loop);
$app = new Ratchet\Http\HttpServer(new Ratchet\WebSocket\WsServer(new BinaryEcho));
$wsServer = new Ratchet\WebSocket\WsServer(new BinaryEcho);
// This is enabled to test https://github.com/ratchetphp/Ratchet/issues/430
// The time is left at 10 minutes so that it will not try to every ping anything
// This causes the Ratchet server to crash on test 2.7
$wsServer->enableKeepAlive($loop, 600);
$app = new Ratchet\Http\HttpServer($wsServer);
$sock->listen($port, '0.0.0.0');