We are using a WampServer to push messages to connected clients using websockets. However, we cannot seem to enable the keepalive property on Wsserver.
When inspecting the frames being send, no keepalive ping/pong ever shows.
The code below shows how we create the servers and enable the keepalive, this is about the same as shown in the Ratchet docs.
Help would be greatly appreciated!
Kind regards,
Floris
Our push-server code that creates the server looks like this:
$loop = React\EventLoop\Factory::create();
$pusher = new Pusher();
$socketServer = new React\Socket\Server($foreignport, $loop);
$wsServer = new WsServer(
new WampServer(
$pusher
)
);
$app = new HttpServer(
$wsServer
);
$webServer = new IoServer(
$app,
$socketServer,
$loop
);
$wsServer->enableKeepAlive($webServer->loop, 30);
$webServer->run();