My Project
UDPServerSocket.h
1
#ifndef __UDPServerSocket_h__
2
#define __UDPServerSocket_h__
3
4
#include "Socket.h"
5
#include "UDPSocket.h"
6
#include "Command.h"
7
8
namespace
core {
9
16
17
class
UDPServerSocket
:
public
UDPSocket
,
public
Command
{
18
19
public
:
20
21
UDPServerSocket
(
EPoll
&ePoll, std::string url,
short
int
port, std::string commandName);
22
~
UDPServerSocket
();
23
24
protected
:
25
26
//---------------------------------------------------------------
27
// Override the virtual dataReceived since for the server these
28
// are requests to accept the new connection socket.
29
//---------------------------------------------------------------
30
31
void
onDataReceived
(std::string data)
override
;
32
33
int
processCommand(std::string request, std::stringstream &data);
34
35
//------------------------------------------------------------------------------------
36
// The retrieved socket connections are placed into the client vector list.
37
//------------------------------------------------------------------------------------
38
39
std::vector<Session *> sessions;
40
41
private
:
42
43
44
};
45
46
}
47
48
#endif
core::UDPSocket
Definition:
UDPSocket.h:8
core::EPoll
Definition:
EPoll.h:31
core::UDPServerSocket::onDataReceived
void onDataReceived(std::string data) override
Called when data is received from the socket.
Definition:
UDPServerSocket.cpp:35
core::Command
Definition:
Command.h:22
core::UDPServerSocket
Definition:
UDPServerSocket.h:17
Generated by
1.8.17