Changeset

6542:32c84e1f706d

net.server_select: Remove socket.sleep call from main loop It's been there since the start; but should really not be required. People can remember an issue with FreeBSD that this solved, but this was a hack solution anyway. If that issue rears it's head again, we will solve it properly.
author daurnimator <quae@daurnimator.com>
date Mon, 19 Jan 2015 14:05:37 -0500
parents 6541:a702786f4f31
children 6543:01cd51777abb
files net/server_select.lua
diffstat 1 files changed, 0 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_select.lua	Mon Jan 19 14:01:11 2015 -0500
+++ b/net/server_select.lua	Mon Jan 19 14:05:37 2015 -0500
@@ -57,7 +57,6 @@
 
 local ssl_wrap = ( has_luasec and luasec.wrap )
 local socket_bind = luasocket.bind
-local socket_sleep = luasocket.sleep
 local socket_select = luasocket.select
 
 --// functions //--
@@ -101,7 +100,6 @@
 local _readtraffic
 
 local _selecttimeout
-local _sleeptime
 local _tcpbacklog
 
 local _starttime
@@ -138,7 +136,6 @@
 _readtraffic = 0
 
 _selecttimeout = 1 -- timeout of socket.select
-_sleeptime = 0 -- time to wait at the end of every loop
 _tcpbacklog = 128 -- some kind of hint to the OS
 
 _maxsendlen = 51000 * 1024 -- max len of send buffer
@@ -790,7 +787,6 @@
 getsettings = function( )
 	return {
 		select_timeout = _selecttimeout;
-		select_sleep_time = _sleeptime;
 		tcp_backlog = _tcpbacklog;
 		max_send_buffer_size = _maxsendlen;
 		max_receive_buffer_size = _maxreadlen;
@@ -808,7 +804,6 @@
 		return nil, "invalid settings table"
 	end
 	_selecttimeout = tonumber( new.select_timeout ) or _selecttimeout
-	_sleeptime = tonumber( new.select_sleep_time ) or _sleeptime
 	_maxsendlen = tonumber( new.max_send_buffer_size ) or _maxsendlen
 	_maxreadlen = tonumber( new.max_receive_buffer_size ) or _maxreadlen
 	_checkinterval = tonumber( new.select_idle_check_interval ) or _checkinterval
@@ -941,9 +936,6 @@
 				end
 			end
 		end
-
-		-- wait some time (0 by default)
-		socket_sleep( _sleeptime )
 	until quitting;
 	if once and quitting == "once" then quitting = nil; return; end
 	return "quitting"