Subject: | Support for ping/ping frames |
Seems that there's currently no detection for ping frames, which can cause the remote server to give up if it was expecting the pong response.
From the source, it appears that this could be fixed by adding the following:
$self->send_frame(
buffer => '',
type => 'pong'
) if $framebuffer->is_ping;
to Net::Async::WebSocket::Protocol->on_read after each frame is processed (note that this would need to happen even when there's no bytes returned, since ping frames have no payload).
Trying to track down an external server to use as a test case, seems that pusherapp.com provides a websocket API which expects ping/pong responses so will update the ticket when I've had a chance to confirm that this works (+ proper patch with test case).
cheers,
Tom