#ifndef __BMAPOP3Session_h__ #define __BMAPOP3Session_h__ #include "BMASession.h" #include "BMAPOP3Server.h" /// /// BMAPOP3Session /// /// Extends the session parameters for this BMATCPSocket derived object. /// Extend the protocol() method in order to define the behavior and /// protocol interaction for this socket which is a console session. /// class BMAPOP3Session : public BMASession { public: BMAPOP3Session(BMAEPoll &ePoll, BMAPOP3Server &server); ~BMAPop3Session(); virtual void output(std::stringstream &out); protected: void protocol(char *data, int length) override; private: BMAConsoleServer &server; enum Status {WELCOME, PROMPT, INPUT, PROCESS, DONE}; Status status = WELCOME; void doCommand(std::string request); }; #endif