Changeset

2534:1f46a9d9b16a

net.server_event: Support :setlistener() method on connections to work with port multiplexing
author Matthew Wild <mwild1@gmail.com>
date Fri, 29 Jan 2010 16:46:28 +0000
parents 2533:d6ca46b834d9
children 2535:75bb31b6c53f
files net/server_event.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_event.lua	Fri Jan 29 21:15:33 2010 +0500
+++ b/net/server_event.lua	Fri Jan 29 16:46:28 2010 +0000
@@ -426,6 +426,11 @@
 		return false, "setoption not implemented";
 	end
 	
+	function interface_mt:setlistener(listener)
+		self.onconnect, self.ondisconnect, self.onincoming, self.ontimeout
+			= listener.onconnect, listener.ondisconnect, listener.onincoming, listener.ontimeout;
+	end
+	
 	-- Stub handlers
 	function interface_mt:onconnect()
 	end