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

@@ -53,15 +53,6 @@ int PIClientServer::ClientBase::write(const void * d, const size_t s) {
}
void PIClientServer::ClientBase::enableSymmetricEncryption(const PIByteArray & key) {
if (key.isNotEmpty()) {
stream.setCryptEnabled(true);
stream.setCryptKey(key);
} else
stream.setCryptEnabled(false);
}
void PIClientServer::ClientBase::init() {
if (!tcp) return;
CONNECTL(&stream, sendRequest, [this](const PIByteArray & ba) {