My Project
ConsoleSession.h
1 #ifndef __ConsoleSession_h__
2 #define __ConsoleSession_h__
3 
4 #include "TerminalSession.h"
5 //#include "TCPServer.h"
6 #include "CommandList.h"
7 
8 namespace core {
9 
10  class TCPServer;
11 
19 
21 
22  public:
23  ConsoleSession(EPoll &ePoll, TCPServer &server);
24  ~ConsoleSession();
25 
26  void writeLog(std::string data);
27 
28  protected:
29  void protocol(coreutils::ZString &data) override;
30 
31  private:
32  enum Status {WELCOME, LOGIN, WAIT_USER_PROFILE, PASSWORD, WAIT_PASSWORD, PROMPT, INPUT, PROCESS, DONE};
33  Status status = WELCOME;
34  void doCommand(coreutils::ZString &request);
35  coreutils::ZString command;
36 
37  };
38 
39 }
40 
41 #endif
Definition: ConsoleSession.h:20
void protocol(coreutils::ZString &data) override
Definition: ConsoleSession.cpp:11
Definition: EPoll.h:31
Definition: TCPServer.h:25
Definition: TerminalSession.h:30