comparison net/server_select.lua @ 6459:ba421af3dfd3

net.server_select: Reset read timeout timer if the event is handled
author Kim Alvefur <zash@zash.se>
date Fri, 03 Oct 2014 14:42:18 +0200
parents b93402cec1c4
children ab68bb837fe0 ec172dbe9d14
comparison
equal deleted inserted replaced
6458:f906b803dc42 6459:ba421af3dfd3
884 for handler, timestamp in pairs( _readtimes ) do 884 for handler, timestamp in pairs( _readtimes ) do
885 if os_difftime( _currenttime - timestamp ) > _readtimeout then 885 if os_difftime( _currenttime - timestamp ) > _readtimeout then
886 if not(handler.onreadtimeout) or handler:onreadtimeout() ~= true then 886 if not(handler.onreadtimeout) or handler:onreadtimeout() ~= true then
887 handler.disconnect( )( handler, "read timeout" ) 887 handler.disconnect( )( handler, "read timeout" )
888 handler:close( ) -- forced disconnect? 888 handler:close( ) -- forced disconnect?
889 else
890 _readtimes[ handler ] = _currenttime -- reset timer
889 end 891 end
890 end 892 end
891 end 893 end
892 end 894 end
893 895