mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
add assert for socket fd reuse
This commit is contained in:
@@ -179,6 +179,7 @@ local function connect(id, func)
|
||||
callback = func,
|
||||
protocol = "TCP",
|
||||
}
|
||||
assert(not socket_pool[id], "socket is not closed")
|
||||
socket_pool[id] = s
|
||||
suspend(s)
|
||||
local err = s.connecting
|
||||
@@ -404,6 +405,7 @@ end
|
||||
local udp_socket = {}
|
||||
|
||||
local function create_udp_object(id, cb)
|
||||
assert(not socket_pool[id], "socket is not closed")
|
||||
socket_pool[id] = {
|
||||
id = id,
|
||||
connected = true,
|
||||
|
||||
Reference in New Issue
Block a user