From 50ac7152afc684b9f73feb65325732eef7b25358 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Mon, 13 Jul 2020 15:02:58 +0200 Subject: [PATCH] Adding file descriptor to pass to the `send` functions. --- src/ipc/context.cr | 4 ++-- src/json.cr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ipc/context.cr b/src/ipc/context.cr index 1b94a4a..97d18c4 100644 --- a/src/ipc/context.cr +++ b/src/ipc/context.cr @@ -110,8 +110,8 @@ class IPC::Context send(fd, utype, Bytes.new(payload.to_unsafe, payload.bytesize)) end - def send(message : IPC::Message) - send(message.fd, message.utype, message.payload) + def send(fd : Int32, message : IPC::Message) + send(fd : Int32, message.fd, message.utype, message.payload) end def read(index : UInt32) diff --git a/src/json.cr b/src/json.cr index a4fbdaf..31145ea 100644 --- a/src/json.cr +++ b/src/json.cr @@ -26,8 +26,8 @@ class IPC::JSON end class IPC::Context - def send(message : IPC::JSON) - send message.type.to_u8, message.to_json + def send(fd : Int32, message : IPC::JSON) + send fd : Int32, message.type.to_u8, message.to_json end end