Changeset

206:1bf01ffcb5a3

plugins.keepalive: Add (thanks chris)
author Matthew Wild <mwild1@gmail.com>
date Fri, 18 Mar 2011 22:15:21 +0000
parents 205:cbcd45be11a8
children 207:78f59d7b1ef7
files plugins/keepalive.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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