aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/connlisteners.lua4
-rw-r--r--net/server.lua8
2 files changed, 9 insertions, 3 deletions
diff --git a/net/connlisteners.lua b/net/connlisteners.lua
index 48101752..7aaee4c0 100644
--- a/net/connlisteners.lua
+++ b/net/connlisteners.lua
@@ -21,11 +21,11 @@ local listeners = {};
function register(name, listener)
if listeners[name] and listeners[name] ~= listener then
- log("warn", "Listener %s is already registered, not registering any more", name);
+ log("debug", "Listener %s is already registered, not registering any more", name);
return false;
end
listeners[name] = listener;
- log("info", "Registered connection listener %s", name);
+ log("debug", "Registered connection listener %s", name);
return true;
end
diff --git a/net/server.lua b/net/server.lua
index fd6459e8..9e42b8ff 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -77,6 +77,7 @@ local idfalse
local addtimer
local closeall
local addserver
+local getserver
local wrapserver
local getsettings
local closesocket
@@ -670,6 +671,10 @@ addserver = function( listeners, port, addr, pattern, sslctx, maxconnections, st
return handler
end
+getserver = function ( port )
+ return _server[ port ];
+end
+
removeserver = function( port )
local handler = _server[ port ]
if not handler then
@@ -728,7 +733,7 @@ stats = function( )
return _readtraffic, _sendtraffic, _readlistlen, _sendlistlen, _timerlistlen
end
-local dontstop = true;
+local dontstop = true; -- thinking about tomorrow, ...
setquitting = function (quit)
dontstop = not quit;
@@ -844,6 +849,7 @@ return {
closeall = closeall,
addtimer = addtimer,
addserver = addserver,
+ getserver = getserver,
getsettings = getsettings,
setquitting = setquitting,
removeserver = removeserver,