Subject: | Missing handler for close frames |
Date: | Tue, 7 May 2013 01:33:05 -0400 |
To: | bug-Net-Async-WebSocket [...] rt.cpan.org |
From: | Topaz <topazstorm [...] gmail.com> |
In Net::Async::WebSocket::Protocol::on_read, it seems like frames which
indicate the end of WebSocket session are not handled; in my testing, the
connections eventually time out, but I'd like to be able to respond to them
immediately.
The correct thing to do is probably to fabricate the appropriate response
packet indicating that the socket is being shut down. However, in my
testing, merely adding this code after the $framebuffer->next loop and
before the return was sufficient:
$self->close() if $framebuffer->is_close;
I leave discerning the correct behavior according to the WebSocket spec to
someone more familiar with it.
Using:
Net-Async-WebSocket-0.06
This is perl 5, version 14, subversion 2 (v5.14.2) built for
x86_64-linux-gnu-thread-multi
Linux 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux