Software /
code /
prosody
Comparison
net/server_select.lua @ 7468:2d38a2519d09
net.server_select: remove unused one-letter loop variables [luacheck]
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 09 Jul 2016 00:37:34 +0800 |
parent | 7323:a1570219b865 |
child | 7477:f9e470026042 |
child | 7501:8c3d93b67560 |
comparison
equal
deleted
inserted
replaced
7466:f28fa742def3 | 7468:2d38a2519d09 |
---|---|
862 if quitting then return "quitting"; end | 862 if quitting then return "quitting"; end |
863 if once then quitting = "once"; end | 863 if once then quitting = "once"; end |
864 local next_timer_time = math_huge; | 864 local next_timer_time = math_huge; |
865 repeat | 865 repeat |
866 local read, write, err = socket_select( _readlist, _sendlist, math_min(_selecttimeout, next_timer_time) ) | 866 local read, write, err = socket_select( _readlist, _sendlist, math_min(_selecttimeout, next_timer_time) ) |
867 for i, socket in ipairs( write ) do -- send data waiting in writequeues | 867 for _, socket in ipairs( write ) do -- send data waiting in writequeues |
868 local handler = _socketlist[ socket ] | 868 local handler = _socketlist[ socket ] |
869 if handler then | 869 if handler then |
870 handler.sendbuffer( ) | 870 handler.sendbuffer( ) |
871 else | 871 else |
872 closesocket( socket ) | 872 closesocket( socket ) |
873 out_put "server.lua: found no handler and closed socket (writelist)" -- this should not happen | 873 out_put "server.lua: found no handler and closed socket (writelist)" -- this should not happen |
874 end | 874 end |
875 end | 875 end |
876 for i, socket in ipairs( read ) do -- receive data | 876 for _, socket in ipairs( read ) do -- receive data |
877 local handler = _socketlist[ socket ] | 877 local handler = _socketlist[ socket ] |
878 if handler then | 878 if handler then |
879 handler.readbuffer( ) | 879 handler.readbuffer( ) |
880 else | 880 else |
881 closesocket( socket ) | 881 closesocket( socket ) |