add PIClientServer::Config, common configuration type for both sides, stream packer and encryption settings
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#ifndef piclientserver_client_base_H
|
||||
#define piclientserver_client_base_H
|
||||
|
||||
#include "pinetworkaddress.h"
|
||||
#include "piclientserver_config.h"
|
||||
#include "pip_client_server_export.h"
|
||||
#include "pistreampacker.h"
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace PIClientServer {
|
||||
class Server;
|
||||
|
||||
class PIP_CLIENT_SERVER_EXPORT ClientBase {
|
||||
friend class Config;
|
||||
friend class Server;
|
||||
NO_COPY_CLASS(ClientBase);
|
||||
|
||||
@@ -50,7 +51,7 @@ public:
|
||||
int write(const void * d, const size_t s);
|
||||
int write(const PIByteArray & ba) { return write(ba.data(), ba.size()); }
|
||||
|
||||
void enableSymmetricEncryption(const PIByteArray & key);
|
||||
Config & configuration() { return config; }
|
||||
|
||||
protected:
|
||||
virtual void readed(PIByteArray data) {}
|
||||
@@ -62,6 +63,7 @@ protected:
|
||||
bool own_tcp = false;
|
||||
std::atomic_bool can_write = {true};
|
||||
PIEthernet * tcp = nullptr;
|
||||
Config config;
|
||||
|
||||
private:
|
||||
void destroy();
|
||||
|
||||
Reference in New Issue
Block a user