local threadm = {}
local threadi = {}
+local _meta = {__mode = "k"}
+setmetatable(threadm, _meta)
+setmetatable(threadi, _meta)
+
+
function Socket(ip, port)
local sock, err = socket.bind( ip, port )
coroutine.resume(thread, client)
local now = os.time()
if coroutine.status(thread) == "dead" then
- threads[client] = nil
threadc = threadc - 1
- threadm[client] = nil
- threadi[client] = nil
+ threads[client] = nil
elseif threadm[client] and threadm[client] + THREAD_TIMEOUT < now then
threads[client] = nil
threadc = threadc - 1