Comparison

plugins/mod_c2s.lua @ 5281:815c689f85ad

prosody, mod_c2s, mod_s2s: Move closing of c2s and s2s sessions to respective plugins
author Kim Alvefur <zash@zash.se>
date Fri, 28 Dec 2012 14:33:47 +0100
parent 5228:edabb34417b7
child 5370:7838acadb0fa
comparison
equal deleted inserted replaced
5280:1514a6147e85 5281:815c689f85ad
263 263
264 function listener.associate_session(conn, session) 264 function listener.associate_session(conn, session)
265 sessions[conn] = session; 265 sessions[conn] = session;
266 end 266 end
267 267
268 module:hook("server-stopping", function(event)
269 local reason = event.reason;
270 for _, session in pairs(sessions) do
271 session:close{ condition = "system-shutdown", text = reason };
272 end
273 end, 1000);
274
275
276
268 module:provides("net", { 277 module:provides("net", {
269 name = "c2s"; 278 name = "c2s";
270 listener = listener; 279 listener = listener;
271 default_port = 5222; 280 default_port = 5222;
272 encryption = "starttls"; 281 encryption = "starttls";