# HG changeset patch # User Matthew Wild # Date 1273069397 -3600 # Node ID fa00c6f563b474085bc807f6b1066a0fb06a9919 # Parent 43a4cb707fe4bb9621006abe2880d7ba8eed3c59 net.server_select, net.server_event: Rename :pattern() method to :set_mode() for select backend, and add :set_mode() to event backend diff -r 43a4cb707fe4 -r fa00c6f563b4 net/server_event.lua --- a/net/server_event.lua Wed May 05 15:21:17 2010 +0100 +++ b/net/server_event.lua Wed May 05 15:23:17 2010 +0100 @@ -402,6 +402,13 @@ self.starttls = false; -- prevent starttls() end end + + function interface_mt:set_mode(pattern) + if pattern then + self._pattern = pattern; + end + return self._pattern; + end function interface_mt:set_send(new_send) -- No-op, we always use the underlying connection's send @@ -599,7 +606,7 @@ interface.eventreadtimeout = nil end end - local buffer, err, part = interface.conn:receive( pattern ) -- receive buffer with "pattern" + local buffer, err, part = interface.conn:receive( interface._pattern ) -- receive buffer with "pattern" --vdebug( "read data:", tostring(buffer), "error:", tostring(err), "part:", tostring(part) ) buffer = buffer or part or "" local len = string_len( buffer ) diff -r 43a4cb707fe4 -r fa00c6f563b4 net/server_select.lua --- a/net/server_select.lua Wed May 05 15:21:17 2010 +0100 +++ b/net/server_select.lua Wed May 05 15:23:17 2010 +0100 @@ -379,7 +379,7 @@ handler.socket = function( self ) return socket end - handler.pattern = function( self, new ) + handler.set_mode = function( self, new ) pattern = new or pattern return pattern end