net.server_select, net.server_event: Support for ondrain listener callback for when send buffer is empty

This commit is contained in:
Matthew Wild 2010-05-05 15:24:24 +01:00
parent 242d67b43e
commit 3c7eb58b08
2 changed files with 9 additions and 1 deletions

View file

@ -465,6 +465,8 @@ do
end
function interface_mt:ontimeout()
end
function interface_mt:ondrain()
end
function interface_mt:onstatus()
debug("server.lua: Dummy onstatus()")
end
@ -545,6 +547,7 @@ do
if succ then -- writing succesful
interface.writebuffer = ""
interface.writebufferlen = 0
interface:ondrain();
if interface.fatalerror then
debug "closing client after writing"
interface:_close() -- close interface if needed