Diff

net/server.lua @ 885:38ed2db19a55

net.server: Allow replacement of send function on an open socket
author Matthew Wild <mwild1@gmail.com>
date Sat, 07 Mar 2009 19:56:53 +0000
parent 868:9e058e51ecaf
child 962:872f5d85636e
line wrap: on
line diff
--- a/net/server.lua	Sat Mar 07 19:40:00 2009 +0000
+++ b/net/server.lua	Sat Mar 07 19:56:53 2009 +0000
@@ -386,6 +386,10 @@
         pattern = new or pattern
         return pattern
     end
+    handler.setsend = function ( newsend )
+        send = newsend or send
+        return send
+    end
     handler.bufferlen = function( readlen, sendlen )
         maxsendlen = sendlen or maxsendlen
         maxreadlen = readlen or maxreadlen