Comparison

util/session.lua @ 6940:2be5e19485aa

util.session: How does a session relate do a connection?
author Kim Alvefur <zash@zash.se>
date Tue, 24 Nov 2015 19:26:27 +0100
parent 6939:a9ae0c6ac4f4
child 6941:33fbc835697d
comparison
equal deleted inserted replaced
6939:a9ae0c6ac4f4 6940:2be5e19485aa
17 local log = logger.init(id); 17 local log = logger.init(id);
18 session.log = log; 18 session.log = log;
19 return session; 19 return session;
20 end 20 end
21 21
22 local function set_conn(session, conn)
23 session.conn = conn;
24 session.ip = conn:ip();
25 return session;
26 end
27
22 return { 28 return {
23 new = new_session; 29 new = new_session;
24 set_id = set_id; 30 set_id = set_id;
25 set_logger = set_logger; 31 set_logger = set_logger;
32 set_conn = set_conn;
26 } 33 }