/home/bradarant/barant/ServerCore/Session.h
#ifndef __Session_h__
#define __Session_h__
#include "TCPSocket.h"
#include "SessionFilter.h"
//#include "Service.h"
namespace core {
class Service;
class Session : public TCPSocket {
public:
Session(EPoll &ePoll, Service &service);
~Session();
virtual void output(std::stringstream &data);
void send();
void sendToAll();
void sendToAll(SessionFilter filter);
std::stringstream out;
Service &service;
protected:
void onDataReceived(std::string data) override;
void onConnected() override;
virtual void protocol(std::string data);
};
}
#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:29
core::Session::output
virtual void output(std::stringstream &data)
Definition: Session.cpp:13
core::Service
Definition: Service.h:20
core::TCPSocket
Definition: TCPSocket.h:20
core::Session::sendToAll
void sendToAll()
Definition: Session.cpp:33
core::Session::onConnected
void onConnected() override
Called when socket is open and ready to communicate.
Definition: Session.cpp:25
core::SessionFilter
Definition: SessionFilter.h:10
core::Session::send
void send()
Definition: Session.cpp:51
core::Session::protocol
virtual void protocol(std::string data)
Definition: Session.cpp:17