add PIClientServer::Config, common configuration type for both sides, stream packer and encryption settings

This commit is contained in:
2024-09-13 11:08:32 +03:00
parent 996b7ea403
commit 17b902ebcc
8 changed files with 125 additions and 25 deletions

View File

@@ -25,6 +25,7 @@
#ifndef piclientserver_server_H
#define piclientserver_server_H
#include "piclientserver_config.h"
#include "pimutex.h"
#include "pinetworkaddress.h"
#include "pip_client_server_export.h"
@@ -55,7 +56,7 @@ public:
void setClientFactory(std::function<ServerClient *()> f) { client_factory = f; }
void enableSymmetricEncryption(const PIByteArray & key);
Config & configuration() { return config; }
private:
void stopServer();
@@ -67,7 +68,7 @@ private:
PIEthernet * tcp_server = nullptr;
PIThread * clean_thread = nullptr;
PIThreadNotifier clean_notifier;
PIByteArray crypt_key;
Config config;
PIVector<ServerClient *> clients;
mutable PIMutex clients_mutex;