net.server_event: Support :setlistener() method on connections to work with port multiplexing
authorMatthew Wild <mwild1@gmail.com>
Fri, 29 Jan 2010 16:46:28 +0000
changeset 2534 1f46a9d9b16a
parent 2533 d6ca46b834d9
child 2535 75bb31b6c53f
net.server_event: Support :setlistener() method on connections to work with port multiplexing
net/server_event.lua
--- 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