Software /
code /
prosody
Annotate
core/sessionmanager.lua @ 36:62998e5319e3
Moved hosts to a config file, still need better config though
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 01 Oct 2008 22:11:28 +0100 |
parent | 30:bcf539295f2d |
child | 38:3fdfd6e0cb4e |
rev | line source |
---|---|
30 | 1 |
2 local tostring = tostring; | |
3 | |
4 local log = require "util.logger".init("sessionmanager"); | |
5 | |
6 module "sessionmanager" | |
7 | |
8 function new_session(conn) | |
9 local session = { conn = conn, notopen = true, priority = 0, type = "c2s_unauthed" }; | |
10 local w = conn.write; | |
11 session.send = function (t) w(tostring(t)); end | |
12 return session; | |
13 end | |
14 | |
15 function send_to_session(session, data) | |
16 log("debug", "Sending...", tostring(data)); | |
17 session.conn.write(tostring(data)); | |
18 end | |
19 | |
20 return _M; |