UDPServerSocket.h
Go to the documentation of this file.
#ifndef __UDPServerSocket_h__
#define __UDPServerSocket_h__
#include "Socket.h"
#include "UDPSocket.h"
#include "Command.h"
namespace core {
class UDPServerSocket : public UDPSocket, public Command {
public:
UDPServerSocket(EPoll &ePoll, std::string url, short int port, std::string commandName);
~UDPServerSocket();
protected:
//---------------------------------------------------------------
// Override the virtual dataReceived since for the server these
// are requests to accept the new connection socket.
//---------------------------------------------------------------
void onDataReceived(std::string data) override;
int processCommand(std::string request, std::stringstream &data);
//------------------------------------------------------------------------------------
// The retrieved socket connections are placed into the client vector list.
//------------------------------------------------------------------------------------
std::vector<Session *> sessions;
private:
};
}
#endif
core::UDPServerSocket::~UDPServerSocket
~UDPServerSocket()
Definition: UDPServerSocket.cpp:31
core::Socket::ePoll
EPoll & ePoll
Definition: Socket.h:117
core::EPoll
Definition: EPoll.h:31
core::UDPSocket
Definition: UDPSocket.h:8
core::UDPServerSocket::onDataReceived
void onDataReceived(std::string data) override
Called when data is received from the socket.
Definition: UDPServerSocket.cpp:35
core::UDPServerSocket::UDPServerSocket
UDPServerSocket(EPoll &ePoll, std::string url, short int port, std::string commandName)
Definition: UDPServerSocket.cpp:7
core
Definition: Command.cpp:5
core::Command
Definition: Command.h:22
UDPSocket.h
core::UDPServerSocket::processCommand
int processCommand(std::string request, std::stringstream &data)
Definition: UDPServerSocket.cpp:47
Command.h
core::UDPServerSocket
Definition: UDPServerSocket.h:17
core::UDPServerSocket::sessions
std::vector< Session * > sessions
Definition: UDPServerSocket.h:39
Socket.h