Project NSCpp. More...
#include <NSC.h>
#include "GroupManager.h"
#include "Serializer.h"
#include <string>
#include <KISS.h>
#include <memory>
#include <vector>
#include <iostream>
#include <sstream>
Go to the source code of this file.
Classes | |
struct | ClientData |
Structure which hold the Client's Data after an event. More... | |
class | ClientPP |
Typedefs | |
typedef struct ClientData | ClientData |
Structure which hold the Client's Data after an event. | |
Enumerations | |
enum class | ClientType { LOCAL , REMOTE } |
Functions | |
template<typename T> | |
auto | createDataCallback (T *ptr, void(T::*method)(std::vector< std::string >)) |
Template which can be used to create DataReceived callbacks from class' methods. | |
template<typename T> | |
auto | createDisconnectionCallback (T *ptr, void(T::*method)()) |
Template which can be used to create Disconnection callbacks from class' methods. | |
void | sendUDP (SOCKET *serverSocket, SIN *addr, IP_Type ipType, std::string message) |
Function to send an UDP message to a client. | |
std::string | domainNameResolution (std::string domainName) |
Wrapper of the resolveDomainName function of NSC, with strings. | |
Project NSCpp.
Client implementation
This Client class give a high level usage of the clients socket.
The objective is to facilitate the usage of the developper.
It has two ways of functioning.
The first one is when it's created by the Server, in this case it represent a Client connected to the server and can be used by the channels to communicate with the client [REMOTE].
The second case is when it's created in the client-sided application, in this case it can be used to communicate with the server [LOCAL].
The class is also made to let you the freedom of derived it for a more convenient usage.
typedef struct ClientData ClientData |
Structure which hold the Client's Data after an event.
|
strong |
auto createDataCallback | ( | T * | ptr, |
void(T::* | method )(std::vector< std::string >) ) |
Template which can be used to create DataReceived callbacks from class' methods.
auto createDisconnectionCallback | ( | T * | ptr, |
void(T::* | method )() ) |
Template which can be used to create Disconnection callbacks from class' methods.
std::string domainNameResolution | ( | std::string | domainName | ) |
Wrapper of the resolveDomainName function of NSC, with strings.
void sendUDP | ( | SOCKET * | serverSocket, |
SIN * | addr, | ||
IP_Type | ipType, | ||
std::string | message ) |
Function to send an UDP message to a client.
Should be used on the server-side.