# HG changeset patch # User Matthew Wild # Date 1369415649 -3600 # Node ID 8a2456f1f117f1270da3d0e428194ab7a9d4ed13 # Parent 78bc91f0d74b182b1c6599e001abaa0c5c9f9b32 net.server_select: Support for listener.onreadtimeout() [see also e67891ad18d6] diff -r 78bc91f0d74b -r 8a2456f1f117 net/server_select.lua --- a/net/server_select.lua Sun May 26 22:59:06 2013 +0200 +++ b/net/server_select.lua Fri May 24 18:14:09 2013 +0100 @@ -861,16 +861,16 @@ _starttime = _currenttime for handler, timestamp in pairs( _writetimes ) do if os_difftime( _currenttime - timestamp ) > _sendtimeout then - --_writetimes[ handler ] = nil handler.disconnect( )( handler, "send timeout" ) handler:force_close() -- forced disconnect end end for handler, timestamp in pairs( _readtimes ) do if os_difftime( _currenttime - timestamp ) > _readtimeout then - --_readtimes[ handler ] = nil - handler.disconnect( )( handler, "read timeout" ) - handler:close( ) -- forced disconnect? + if not(handler.onreadtimeout) or handler:onreadtimeout() ~= true then + handler.disconnect( )( handler, "read timeout" ) + handler:close( ) -- forced disconnect? + end end end end