NSCpp 2.0
NSCpp is a modern C++20 server/client framework designed to simplify network programming in C++. With robust support for both IPv4 and IPv6, as well as TCP and UDP communication protocols.
 
Loading...
Searching...
No Matches
ClientPP.h File Reference

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.
 

Detailed Description

Project NSCpp.

Author
Thomas K/BIDI
Version
2.0

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 Documentation

◆ ClientData

typedef struct ClientData ClientData

Structure which hold the Client's Data after an event.

Enumeration Type Documentation

◆ ClientType

enum class ClientType
strong
Enumerator
LOCAL 

Client-Side.

REMOTE 

Server-Side.

Function Documentation

◆ createDataCallback()

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.

◆ createDisconnectionCallback()

template<typename T>
auto createDisconnectionCallback ( T * ptr,
void(T::* method )() )

Template which can be used to create Disconnection callbacks from class' methods.

◆ domainNameResolution()

std::string domainNameResolution ( std::string domainName)

Wrapper of the resolveDomainName function of NSC, with strings.

◆ sendUDP()

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.

See also
ClientPP::send To send messages from the client side