Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added heartbeat to WebSockets too

  • Loading branch information...
commit e88ce28e54d36a1c6dbb4d8ca8b1589a6cfd50fd 1 parent 3334ebd
@vti authored
Showing with 6 additions and 1 deletion.
  1. +3 −1 Changes
  2. +3 −0  lib/Plack/Middleware/SocketIO/WebSocket.pm
View
4 Changes
@@ -2,7 +2,9 @@ Revision history for perl module Plack::Middleware::SocketIO
0.009003
- - It is possible to pass class name and method instead of inline handler
+ - It is possible to pass class name or instance and method instead of inline
+ handler
+ - Added heartbeat to WebSockets too
0.009002 2011-03-29
View
3  lib/Plack/Middleware/SocketIO/WebSocket.pm
@@ -36,6 +36,9 @@ sub finalize {
my $conn = $self->add_connection(on_connect => $cb);
+ $handle->heartbeat_timeout(10);
+ $handle->on_heartbeat(sub { $conn->send_heartbeat });
+
$handle->on_read(
sub {
my $handle = shift;
Please sign in to comment.
Something went wrong with that request. Please try again.