From f2335bb38bca2c4d4412a563472c3110eaf9f154 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Sun, 3 Jan 2021 13:12:49 +0800 Subject: [PATCH] =?UTF-8?q?send=E4=B9=8B=E5=89=8D=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E7=AE=80=E5=8D=95=E6=A3=80=E6=9F=A5=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E4=B8=AA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ipc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ipc.cpp b/src/ipc.cpp index 5de1a73..cd15a88 100755 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -435,6 +435,10 @@ static bool send(F&& gen_push, ipc::handle_t h, void const * data, std::size_t s ipc::error("fail: send, que->ready_sending() == false\n"); return false; } + if (que->elems()->connections(std::memory_order_relaxed) == 0) { + ipc::error("fail: send, there is no receiver on this connection.\n"); + return false; + } // calc a new message id auto acc = info_of(h)->acc(); if (acc == nullptr) {