mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
Check self.__sock before dispatch, See #1513
This commit is contained in:
@@ -321,7 +321,10 @@ local function connect_once(self)
|
|||||||
|
|
||||||
self.__sock = setmetatable( {fd} , channel_socket_meta )
|
self.__sock = setmetatable( {fd} , channel_socket_meta )
|
||||||
self.__dispatch_thread = skynet.fork(function()
|
self.__dispatch_thread = skynet.fork(function()
|
||||||
|
if self.__sock then
|
||||||
|
-- self.__sock can be false (socket closed) if error during connecting, See #1513
|
||||||
pcall(dispatch_function(self), self)
|
pcall(dispatch_function(self), self)
|
||||||
|
end
|
||||||
-- clear dispatch_thread
|
-- clear dispatch_thread
|
||||||
self.__dispatch_thread = nil
|
self.__dispatch_thread = nil
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user