amphp / websocket-client

Async WebSocket client for PHP based on Amp.

Home Page:https://amphp.org/websocket-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pings regularly, not in blocking receive wait?

programmin1 opened this issue · comments

This is a very handy library... but what if I want to listen, as in the example

while ($message = yield $connection->receive()) { ...

but also ping every x seconds even if there was nothing received?
A websocket might need regular pings to stay active.

Pings are automatically sent, or so you want to send a message instead of a websocket ping?