From 2b3fe276a510c0e75f1ecfb363c487ef0717d6ea Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Tue, 20 Feb 2024 17:14:13 +0100 Subject: [PATCH] Implement Keep Alive messages. --- src/requests/keepalive.cr | 11 +++++++++++ src/responses/keepalive.cr | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 src/requests/keepalive.cr create mode 100644 src/responses/keepalive.cr diff --git a/src/requests/keepalive.cr b/src/requests/keepalive.cr new file mode 100644 index 0000000..2f0fffa --- /dev/null +++ b/src/requests/keepalive.cr @@ -0,0 +1,11 @@ +class DNSManager::Request + IPC::JSON.message KeepAlive, 250 do + def initialize() + end + + def handle(dnsmanagerd : DNSManager::Service, event : IPC::Event) : IPC::JSON + Response::KeepAlive.new + end + end + DNSManager.requests << KeepAlive +end diff --git a/src/responses/keepalive.cr b/src/responses/keepalive.cr new file mode 100644 index 0000000..5edb460 --- /dev/null +++ b/src/responses/keepalive.cr @@ -0,0 +1,7 @@ +class DNSManager::Response + IPC::JSON.message KeepAlive, 250 do + def initialize() + end + end + DNSManager.responses << KeepAlive +end