root/lang/c/partty/trunk/gate.h @ 6991

Revision 6991, 1.0 kB (checked in by frsyuki, 5 years ago)

lang/c/partty: added partty-scale

Line 
1#include "partty.h"
2#include "emtelnet.h"
3
4namespace Partty {
5
6
7class phrase_telnetd : public emtelnet {
8private:
9        static void pass_through_handler(char cmd, bool sw, emtelnet& base) {}
10public:
11        phrase_telnetd();
12private:
13        phrase_telnetd(const phrase_telnetd&);
14};
15
16
17class GateIMPL {
18public:
19        GateIMPL(int listen_socket);
20        ~GateIMPL();
21        int run(void);
22        void signal_end(void);
23private:
24        int accept_guest(void);
25        static ssize_t write_message(phrase_telnetd& td, int guest, const char* buf, size_t count);
26        static ssize_t read_line(phrase_telnetd& td, int guest, char* buf, size_t count);
27private:
28        int socket;
29        char gate_path[PATH_MAX + MAX_SESSION_NAME_LENGTH];
30        size_t gate_dir_len;
31        sig_atomic_t m_end;
32private:
33        GateIMPL();
34        GateIMPL(const GateIMPL&);
35private:
36        static const int E_SUCCESS = 0;
37        static const int E_ACCEPT = 1;
38        static const int E_FINISH = 2;
39        static const int E_SENDFD = 3;
40        static const int E_SESSION_NAME   = 4;
41        static const int E_PASSWORD = 5;
42};
43
44
45}  // namespace Partty
46
Note: See TracBrowser for help on using the browser.