Initial repository 1.0.0
This commit is contained in:
commit
d8b1275884
1861 files changed
+66342
No files matched your search
@@ -0,0 +1,48 @@
|
||||
#ifndef __UDPServerSocket_h__
|
||||
#define __UDPServerSocket_h__
|
||||
|
||||
#include "Socket.h"
|
||||
#include "UDPSocket.h"
|
||||
#include "Command.h"
|
||||
|
||||
namespace core {
|
||||
|
||||
///
|
||||
/// UDPSocket
|
||||
///
|
||||
/// Manage a socket connection as a UDP server type. Connections to the socket are processed through
|
||||
/// the session list functionality. A list of sessions is maintained in a vector object.
|
||||
///
|
||||
|
||||
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(Session *session);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// The retrieved socket connections are placed into the client vector list.
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
std::vector<Session *> sessions;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user