Comparison

net/server_select.lua @ 8728:41c959c5c84b

Fix spelling throughout the codebase [codespell]
author Kim Alvefur <zash@zash.se>
date Sun, 04 Feb 2018 01:51:25 +0100
parent 8528:67311cda0625
child 8749:fb3cd6b2263b
comparison
equal deleted inserted replaced
8727:285075a27f28 8728:41c959c5c84b
130 _closelist = { } -- handlers to close 130 _closelist = { } -- handlers to close
131 _fullservers = { } -- servers in a paused state while there are too many clients 131 _fullservers = { } -- servers in a paused state while there are too many clients
132 132
133 _readlistlen = 0 -- length of readlist 133 _readlistlen = 0 -- length of readlist
134 _sendlistlen = 0 -- length of sendlist 134 _sendlistlen = 0 -- length of sendlist
135 _timerlistlen = 0 -- lenght of timerlist 135 _timerlistlen = 0 -- length of timerlist
136 136
137 _sendtraffic = 0 -- some stats 137 _sendtraffic = 0 -- some stats
138 _readtraffic = 0 138 _readtraffic = 0
139 139
140 _selecttimeout = 1 -- timeout of socket.select 140 _selecttimeout = 1 -- timeout of socket.select
418 local write = function( self, data ) 418 local write = function( self, data )
419 if not handler then return false end 419 if not handler then return false end
420 bufferlen = bufferlen + #data 420 bufferlen = bufferlen + #data
421 if bufferlen > maxsendlen then 421 if bufferlen > maxsendlen then
422 _closelist[ handler ] = "send buffer exceeded" -- cannot close the client at the moment, have to wait to the end of the cycle 422 _closelist[ handler ] = "send buffer exceeded" -- cannot close the client at the moment, have to wait to the end of the cycle
423 handler.write = idfalse -- dont write anymore 423 handler.write = idfalse -- don't write anymore
424 return false 424 return false
425 elseif socket and not _sendlist[ socket ] then 425 elseif socket and not _sendlist[ socket ] then
426 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen) 426 _sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
427 end 427 end
428 bufferqueuelen = bufferqueuelen + 1 428 bufferqueuelen = bufferqueuelen + 1
529 end 529 end
530 --out_put( "server.lua: sended '", buffer, "', bytes: ", tostring(succ), ", error: ", tostring(err), ", part: ", tostring(byte), ", to: ", tostring(ip), ":", tostring(clientport) ) 530 --out_put( "server.lua: sended '", buffer, "', bytes: ", tostring(succ), ", error: ", tostring(err), ", part: ", tostring(byte), ", to: ", tostring(ip), ":", tostring(clientport) )
531 else 531 else
532 succ, err, count = false, "unexpected close", 0; 532 succ, err, count = false, "unexpected close", 0;
533 end 533 end
534 if succ then -- sending succesful 534 if succ then -- sending successful
535 bufferqueuelen = 0 535 bufferqueuelen = 0
536 bufferlen = 0 536 bufferlen = 0
537 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist 537 _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) -- delete socket from writelist
538 _writetimes[ handler ] = nil 538 _writetimes[ handler ] = nil
539 if drain then 539 if drain then