Comparison

core/sessionmanager.lua @ 2103:0e0bc74c64a0

sessionmanager: Use : syntax for calling connection methods
author Matthew Wild <mwild1@gmail.com>
date Sat, 21 Nov 2009 17:07:22 +0000
parent 1929:b8e6764ffefd
child 2144:8e59d37a0e68
comparison
equal deleted inserted replaced
2099:73e083d01449 2103:0e0bc74c64a0
48 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end; 48 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end;
49 end 49 end
50 open_sessions = open_sessions + 1; 50 open_sessions = open_sessions + 1;
51 log("debug", "open sessions now: ".. open_sessions); 51 log("debug", "open sessions now: ".. open_sessions);
52 local w = conn.write; 52 local w = conn.write;
53 session.send = function (t) w(tostring(t)); end 53 session.send = function (t) w(conn, tostring(t)); end
54 session.ip = conn.ip(); 54 session.ip = conn:ip();
55 local conn_name = "c2s"..tostring(conn):match("[a-f0-9]+$"); 55 local conn_name = "c2s"..tostring(conn):match("[a-f0-9]+$");
56 session.log = logger.init(conn_name); 56 session.log = logger.init(conn_name);
57 57
58 if c2s_timeout then 58 if c2s_timeout then
59 add_task(c2s_timeout, function () 59 add_task(c2s_timeout, function ()