add encryption
This commit is contained in:
9
main.cpp
9
main.cpp
@@ -28,7 +28,7 @@ protected:
|
||||
send_thread.start(
|
||||
[this] {
|
||||
// write((PIString::fromNumber(++counter)).toUTF8());
|
||||
PIByteArray ba(64_MiB);
|
||||
PIByteArray ba(64_KiB);
|
||||
write(ba);
|
||||
},
|
||||
2_Hz);
|
||||
@@ -41,20 +41,21 @@ protected:
|
||||
int main(int argc, char * argv[]) {
|
||||
kbd.enableExitCapture();
|
||||
|
||||
piCout << argc;
|
||||
|
||||
PIClientServer::Server * s = nullptr;
|
||||
PIClientServer::Client * c = nullptr;
|
||||
|
||||
if (argc > 1) {
|
||||
// server
|
||||
piCout << "Server";
|
||||
s = new PIClientServer::Server();
|
||||
s->setClientFactory([] { return new MyClient(); });
|
||||
s->enableSymmetricEncryption("1122334455667788"_hex);
|
||||
s->listenAll(12345);
|
||||
} else {
|
||||
// client
|
||||
piCout << "Client";
|
||||
c = new MyClient();
|
||||
c->createNew();
|
||||
c->enableSymmetricEncryption("1122334455667788"_hex);
|
||||
c->connect(PINetworkAddress::resolve("127.0.0.1", 12345));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user