/home/barant/Development/BMA/server_core/ServerCore/BMASession.h
#ifndef __BMASession_h__
#define __BMASession_h__
#include "BMATCPSocket.h"
#include "BMATCPServerSocket.h"
#include "BMASessionFilter.h"
class BMASession : public BMATCPSocket {
public:
BMASession(BMAEPoll &ePoll, BMATCPServerSocket &server);
~BMASession();
virtual void init();
virtual void output(BMASession *session);
void send();
void sendToAll();
void sendToAll(BMASessionFilter *filter);
std::stringstream out;
BMATCPServerSocket &getServer();
BMATCPServerSocket &server;
protected:
void onDataReceived(std::string data) override;
void onConnected() override;
virtual void protocol(std::string data) = 0;
private:
};
#endif
BMASession::onConnected
void onConnected() override
Called when socket is open and ready to communicate.
Definition: BMASession.cpp:23
BMATCPSocket
Definition: BMATCPSocket.h:18
BMASession::send
void send()
Definition: BMASession.cpp:49
BMATCPServerSocket
Definition: BMATCPServerSocket.h:20
BMASession::onDataReceived
void onDataReceived(std::string data) override
Called when data is received from the socket.
Definition: BMASession.cpp:27
BMAEPoll
Definition: BMAEPoll.h:29
BMASession::sendToAll
void sendToAll()
Definition: BMASession.cpp:31
BMASessionFilter
Definition: BMASessionFilter.h:4
BMASession
Definition: BMASession.h:18