# HG changeset patch # User Matthew Wild # Date 1300486521 0 # Node ID 1bf01ffcb5a37085a414190a42192540a3ec9a32 # Parent cbcd45be11a8a86d6f070953e81deefb82f34b2f plugins.keepalive: Add (thanks chris) diff -r cbcd45be11a8 -r 1bf01ffcb5a3 plugins/keepalive.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/keepalive.lua Fri Mar 18 22:15:21 2011 +0000 @@ -0,0 +1,7 @@ +function verse.plugins.keepalive(stream) + stream.keepalive_timeout = stream.keepalive_timeout or 300; + verse.add_task(stream.keepalive_timeout, function () + stream.conn:write(" "); + return stream.keepalive_timeout; + end); +end