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
DebugChannel.h
Go to the documentation of this file.
1
6
7
8#ifndef _DEBUGCHANNEL_H
9#define _DEBUGCHANNEL_H
10
11#include "Channel.h"
12#include "GroupManager.h"
13#include <sstream>
14#include <iostream>
15
16class DebugChannel: public Channel {
17public:
27 DebugChannel(const std::string& key, std::ostream& stream, bool echo = false, const std::string& logKey = "logChannel", bool doLogging = true);
28
32 void run(std::stop_token st);
33
34protected:
38 std::ostream& stream;
39
43 bool logging;
44
48 bool echo;
49
53 std::string logKey;
54};
55
56#endif //_DEBUGCHANNEL_H
Project NSCpp.
std::string key
This key must be unique on the server on which it is plugged.
Definition Channel.h:98
Channel(const std::string &key)
Constructor of the Channel's class.
DebugChannel(const std::string &key, std::ostream &stream, bool echo=false, const std::string &logKey="logChannel", bool doLogging=true)
Constructor of the DebugChannel.
bool echo
Tells if the channel echo back (with the same protocol) to the client.
Definition DebugChannel.h:48
bool logging
Tells if the channel is supposed to log.
Definition DebugChannel.h:43
std::string logKey
Key of the log channel's group.
Definition DebugChannel.h:53
void run(std::stop_token st)
Run method of the Channel, process the given events.
std::ostream & stream
Debug's stream.
Definition DebugChannel.h:38