From b0249c4d4a286172d1f548d0a65bf6154b34e1e8 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 28 Dec 2012 14:33:27 +0100 Subject: net.server_select: Pause servers while they are full --- net/server_select.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/server_select.lua') diff --git a/net/server_select.lua b/net/server_select.lua index 97c29b8c..97b9f199 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -185,6 +185,9 @@ wrapserver = function( listeners, socket, ip, serverport, pattern, sslctx, maxco end handler.remove = function( ) connections = connections - 1 + if handler then + handler.resume( ) + end end handler.close = function() socket:close( ) @@ -227,6 +230,7 @@ wrapserver = function( listeners, socket, ip, serverport, pattern, sslctx, maxco end handler.readbuffer = function( ) if connections > maxconnections then + handler.pause( ) out_put( "server.lua: refused new client connection: server full" ) return false end -- cgit v1.2.3