more error message for socket, and close listen socket when reach limit of open files. See Issue #339

This commit is contained in:
Cloud Wu
2015-09-15 14:52:30 +08:00
parent 6c33f7bc44
commit b8f419eb69
4 changed files with 56 additions and 21 deletions

View File

@@ -101,17 +101,24 @@ function gateserver.start(handler)
end
function MSG.close(fd)
if handler.disconnect then
handler.disconnect(fd)
if fd ~= socket then
if handler.disconnect then
handler.disconnect(fd)
end
close_fd(fd)
end
close_fd(fd)
end
function MSG.error(fd, msg)
if handler.error then
handler.error(fd, msg)
if fd == socket then
socketdriver.close(fd)
skynet.error(msg)
else
if handler.error then
handler.error(fd, msg)
end
close_fd(fd)
end
close_fd(fd)
end
function MSG.warning(fd, size)