refactoring PICrypt, add PIStreamPackerConfig, delete piclientserver_config

This commit is contained in:
2024-10-18 18:59:20 +03:00
parent 28f3471036
commit 92a0a9356c
16 changed files with 220 additions and 387 deletions

View File

@@ -142,7 +142,8 @@ int main(int argc, char * argv[]) {
piCout << "Server";
s = new PIClientServer::Server();
s->setClientFactory([] { return new MyServerClient(); });
s->configuration().enableSymmetricEncryption("1122334455667788"_hex);
s->setCryptEnabled(true);;
s->setCryptKey("1122334455667788"_hex);
s->listenAll(12345);
s_thread->start(
[s] {
@@ -161,7 +162,8 @@ int main(int argc, char * argv[]) {
piForTimes(2) {
piMSleep(25);
auto c = new MyClient();
c->configuration().enableSymmetricEncryption("1122334455667788"_hex);
c->configuration().setCryptEnabled(true);
c->configuration().setCryptKey("1122334455667788"_hex);
c->connect(PINetworkAddress::resolve("127.0.0.1", 12345));
cv << c;
}