From 7d4d59a073b180c7612b44f8741fe9e7846c2041 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Tue, 14 Jul 2020 17:46:45 +0200 Subject: [PATCH] Client can send messages. --- src/authd.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/authd.cr b/src/authd.cr index 1f63015..deb7e2d 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -582,7 +582,11 @@ end class IPC::Client def send(request : AuthD::Request) - send @server_fd, request.type.to_u8, request.to_json + unless (fd = @server_fd).nil? + send fd, request.type.to_u8, request.to_json + else + raise "Client not connected to the server" + end end end