# HG changeset patch # User Matthew Wild # Date 1259273989 0 # Node ID cf7192f48c560b41291f7b2025967206a601eaf1 # Parent 91b9587a021022cbe8c21a0a9755ad8e8523a113 net.server_event: Count the number of client connections *upwards* :) diff -r 91b9587a0210 -r cf7192f48c56 net/server_event.lua --- a/net/server_event.lua Thu Nov 26 22:18:44 2009 +0000 +++ b/net/server_event.lua Thu Nov 26 22:19:49 2009 +0000 @@ -263,7 +263,7 @@ _ = self.eventreadtimeout and self.eventreadtimeout:close( ) _ = self.ondisconnect and self:ondisconnect( self.fatalerror ) -- call ondisconnect listener (wont be the case if handshake failed on connect) _ = self.conn and self.conn:close( ) -- close connection, must also be called outside of any socket registered events! - self._server:counter(-1); + _ = self._server and self._server:counter(-1); self.eventread, self.eventwrite = nil, nil self.eventstarthandshake, self.eventhandshake, self.eventclose = nil, nil, nil self.readcallback, self.writecallback = nil, nil @@ -283,7 +283,7 @@ function interface_mt:counter(c) if c then - self._connections = self._connections - c + self._connections = self._connections + c end return self._connections end