Skip Menu |

This queue is for tickets about the Net-Async-WebSocket CPAN distribution.

Report information
The Basics
Id: 92476
Status: resolved
Priority: 0/
Queue: Net-Async-WebSocket

People
Owner: Nobody in particular
Requestors: TEAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.07
Fixed in: 0.11



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
Confirmed with external server - there's another minor issue which I'll raise separately. Now I just have to write up a test case =)
Seems a little tricky to implement this one nicely, because of https://github.com/vti/protocol-websocket/issues/27 Ultimately, the ping frame's payload may not be valid UTF-8, but you'd have to know whether to call ->next or ->next_bytes. -- Paul Evans
On Sat Jan 25 23:32:19 2014, TEAM wrote: Show quoted text
> 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.
These should now be supported by 0.11. -- Paul Evans