socket.write return nil when write to a closed fd

This commit is contained in:
云风
2013-07-24 14:22:04 +08:00
parent cb31f144f1
commit e6667d5a32

View File

@@ -218,7 +218,11 @@ function socket.readline(fd, sep)
end
function socket.write(fd, msg, sz)
if CLOSED[fd] or not READBUF[fd] then
return
end
skynet.send(".socket", "client", fd, msg, sz)
return true
end
function socket.lock(fd)