Software /
code /
prosody
Comparison
plugins/mod_admin_shell.lua @ 12398:478fff93ac37
mod_admin_shell: Add session.is_connected() method
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 17 Mar 2022 10:23:12 +0000 |
parent | 12397:ddf02f2a3354 |
child | 12399:d99772b739e0 |
comparison
equal
deleted
inserted
replaced
12397:ddf02f2a3354 | 12398:478fff93ac37 |
---|---|
102 write = function (t) | 102 write = function (t) |
103 return send_repl_output(admin_session, t, { eol = "0" }); | 103 return send_repl_output(admin_session, t, { eol = "0" }); |
104 end; | 104 end; |
105 serialize = tostring; | 105 serialize = tostring; |
106 disconnect = function () admin_session:close(); end; | 106 disconnect = function () admin_session:close(); end; |
107 is_connected = function () | |
108 return not not admin_session.conn; | |
109 end | |
107 }; | 110 }; |
108 session.env = setmetatable({}, default_env_mt); | 111 session.env = setmetatable({}, default_env_mt); |
109 | 112 |
110 session.thread = async.runner(function (line) | 113 session.thread = async.runner(function (line) |
111 console:process_line(session, line); | 114 console:process_line(session, line); |