# HG changeset patch # User Matthew Wild # Date 1380390048 -3600 # Node ID b8c7656481aca2179633fe7d12919ea4e04b6a60 # Parent c48f717c2fd6166776021ea79452c3ffa3ae0029 server_select: fix onreadtimeout support so that listeners can override the default (disconnect) behaviour diff -r c48f717c2fd6 -r b8c7656481ac net/server_select.lua --- a/net/server_select.lua Thu Sep 26 16:55:39 2013 +0200 +++ b/net/server_select.lua Sat Sep 28 18:40:48 2013 +0100 @@ -284,6 +284,7 @@ local status = listeners.onstatus local disconnect = listeners.ondisconnect local drain = listeners.ondrain + local onreadtimeout = listeners.onreadtimeout; local bufferqueue = { } -- buffer array local bufferqueuelen = 0 -- end of buffer array @@ -312,11 +313,14 @@ handler.disconnect = function( ) return disconnect end + handler.onreadtimeout = onreadtimeout; + handler.setlistener = function( self, listeners ) dispatch = listeners.onincoming disconnect = listeners.ondisconnect status = listeners.onstatus drain = listeners.ondrain + handler.onreadtimeout = listeners.onreadtimeout end handler.getstats = function( ) return readtraffic, sendtraffic