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

/home/barant/Development/BMA/server_core/ServerCore/TCPServerSocket.h
#ifndef __TCPServerSocket_h__
#define __TCPServerSocket_h__
#include "Socket.h"
#include "TCPSocket.h"
#include "Command.h"
#include "CommandList.h"
namespace core {
class TCPServerSocket : public TCPSocket, public Command {
public:
TCPServerSocket(EPoll &ePoll, std::string url, short int port);
~TCPServerSocket();
void removeFromSessionList(Session *session);
std::vector<Session *> sessions;
CommandList commands;
protected:
virtual void init();
virtual Session * getSocketAccept() = 0;
void onDataReceived(std::string data) override;
int processCommand(std::string command, Session *session) override;
private:
Session * accept();
};
}
#endif
core::EPoll
Definition: EPoll.h:31
core
Definition: Command.cpp:4
core::Session
Definition: Session.h:22
core::TCPServerSocket::getSocketAccept
virtual Session * getSocketAccept()=0
core::TCPServerSocket::onDataReceived
void onDataReceived(std::string data) override
Definition: TCPServerSocket.cpp:40
core::TCPServerSocket::TCPServerSocket
TCPServerSocket(EPoll &ePoll, std::string url, short int port)
Definition: TCPServerSocket.cpp:8
core::TCPServerSocket::sessions
std::vector< Session * > sessions
Definition: TCPServerSocket.h:50
core::TCPServerSocket::processCommand
int processCommand(std::string command, Session *session) override
Definition: TCPServerSocket.cpp:59
core::Command
Definition: Command.h:18
core::TCPSocket
Definition: TCPSocket.h:20
core::CommandList
Definition: CommandList.h:9
core::TCPServerSocket
Definition: TCPServerSocket.h:23
core::TCPServerSocket::~TCPServerSocket
~TCPServerSocket()
Definition: TCPServerSocket.cpp:34