# BMA Server Framework: /home/barant/Development/BMA/server_core/ServerCore/Session.h Source File

/home/barant/Development/BMA/server_core/ServerCore/Session.h
#ifndef __Session_h__
#define __Session_h__
#include "TCPSocket.h"
//#include "TCPServerSocket.h"
#include "SessionFilter.h"
namespace core {
class TCPServerSocket;
class Session : public TCPSocket {
public:
Session(EPoll &ePoll, TCPServerSocket &server);
~Session();
virtual void init();
virtual void output(Session *session);
void send();
void sendToAll();
void sendToAll(SessionFilter *filter);
std::stringstream out;
TCPServerSocket &getServer();
TCPServerSocket &server;
protected:
void onDataReceived(std::string data) override;
void onConnected() override;
virtual void protocol(std::string data) = 0;
private:
};
}
#endif
core::EPoll
Definition: EPoll.h:31
core
Definition: Command.cpp:4
core::Session
Definition: Session.h:22
core::Session::onDataReceived
void onDataReceived(std::string data) override
Called when data is received from the socket.
Definition: Session.cpp:30
core::TCPSocket
Definition: TCPSocket.h:20
core::Session::sendToAll
void sendToAll()
Definition: Session.cpp:34
core::Session::onConnected
void onConnected() override
Called when socket is open and ready to communicate.
Definition: Session.cpp:26
core::SessionFilter
Definition: SessionFilter.h:10
core::Session::send
void send()
Definition: Session.cpp:52
core::TCPServerSocket
Definition: TCPServerSocket.h:23