Comparison

net/server_event.lua @ 2941:a2b01936f8f9

net.server_event: Don't re-try a write if the connection closed (thanks Flo)
author Matthew Wild <mwild1@gmail.com>
date Thu, 25 Mar 2010 12:32:25 +0000
parent 2939:dc73cbc69bd5
child 2952:5069534f7f36
comparison
equal deleted inserted replaced
2939:dc73cbc69bd5 2941:a2b01936f8f9
533 elseif interface.eventreadtimeout then 533 elseif interface.eventreadtimeout then
534 return EV_WRITE, EV_TIMEOUT 534 return EV_WRITE, EV_TIMEOUT
535 end 535 end
536 interface.eventwrite = nil 536 interface.eventwrite = nil
537 return -1 537 return -1
538 elseif byte then -- want write again 538 elseif byte and (err == "timeout" or err == "wantwrite") then -- want write again
539 --vdebug( "writebuffer is not empty:", err ) 539 --vdebug( "writebuffer is not empty:", err )
540 interface.writebuffer = string_sub( interface.writebuffer, byte + 1, interface.writebufferlen ) -- new buffer 540 interface.writebuffer = string_sub( interface.writebuffer, byte + 1, interface.writebufferlen ) -- new buffer
541 interface.writebufferlen = interface.writebufferlen - byte 541 interface.writebufferlen = interface.writebufferlen - byte
542 if "wantread" == err then -- happens only with luasec 542 if "wantread" == err then -- happens only with luasec
543 local callback = function( ) 543 local callback = function( )