Comparison

core/s2smanager.lua @ 199:eccf66b42bd7

Added resource priority handling, etc
author Waqas Hussain <waqas20@gmail.com>
date Sun, 02 Nov 2008 06:36:42 +0500
parent 191:e64c8a44060f
child 225:bbbd169b326b
comparison
equal deleted inserted replaced
193:13ac34255c37 199:eccf66b42bd7
55 end 55 end
56 56
57 local open_sessions = 0; 57 local open_sessions = 0;
58 58
59 function new_incoming(conn) 59 function new_incoming(conn)
60 local session = { conn = conn, priority = 0, type = "s2sin_unauthed", direction = "incoming" }; 60 local session = { conn = conn, type = "s2sin_unauthed", direction = "incoming" };
61 if true then 61 if true then
62 session.trace = newproxy(true); 62 session.trace = newproxy(true);
63 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; print("s2s session got collected, now "..open_sessions.." s2s sessions are allocated") end; 63 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; print("s2s session got collected, now "..open_sessions.." s2s sessions are allocated") end;
64 end 64 end
65 open_sessions = open_sessions + 1; 65 open_sessions = open_sessions + 1;