aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2013-04-16 18:18:22 -0400
committerWaqas Hussain <waqas20@gmail.com>2013-04-16 18:18:22 -0400
commitf76ad9a7f360ddb10e694bfffccd3b5388e87eca (patch)
tree41bc5828af68df37fb0eea1bf33e9dd807626e60
parent65d488d97548f04cdece2495f5f8c84f154f0073 (diff)
downloadprosody-f76ad9a7f360ddb10e694bfffccd3b5388e87eca.tar.gz
prosody-f76ad9a7f360ddb10e694bfffccd3b5388e87eca.zip
net.server_select: Add and improve some comments.
-rw-r--r--net/server_select.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index 86c9daef..983b06a2 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -847,6 +847,7 @@ loop = function(once) -- this is the main loop of the program
end
_currenttime = luasocket_gettime( )
+ -- Check for socket timeouts
local difftime = os_difftime( _currenttime - _starttime )
if difftime > _checkinterval then
_starttime = _currenttime
@@ -866,6 +867,7 @@ loop = function(once) -- this is the main loop of the program
end
end
+ -- Fire timers
if _currenttime - _timer >= math_min(next_timer_time, 1) then
next_timer_time = math_huge;
for i = 1, _timerlistlen do
@@ -876,8 +878,9 @@ loop = function(once) -- this is the main loop of the program
else
next_timer_time = next_timer_time - (_currenttime - _timer);
end
- socket_sleep( _sleeptime ) -- wait some time
- --collectgarbage( )
+
+ -- wait some time (0 by default)
+ socket_sleep( _sleeptime )
until quitting;
if once and quitting == "once" then quitting = nil; return; end
return "quitting"