From 9e000da81f660ac6bd5363be11c6f0ccd3548927 Mon Sep 17 00:00:00 2001 From: yzj12138 <71420106+yzj12138@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8Cskynet.exit?= =?UTF-8?q?=E5=90=8E=E5=88=AB=E7=9A=84=E6=9C=8D=E5=8A=A1call=E6=9C=89?= =?UTF-8?q?=E6=A6=82=E7=8E=87=E5=8D=A1=E6=AD=BB=20(#1846)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: xingfan.yzj --- lualib/skynet.lua | 4 +++- skynet-src/skynet_server.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lualib/skynet.lua b/lualib/skynet.lua index b26b4547..84c649e8 100644 --- a/lualib/skynet.lua +++ b/lualib/skynet.lua @@ -652,7 +652,9 @@ function skynet.exit() for address in pairs(tmp) do c.send(address, skynet.PTYPE_ERROR, 0, "") end - c.callback(function() end) + c.callback(function(prototype, msg, sz, session, source) + c.send(source, skynet.PTYPE_ERROR, session, "") + end) c.command("EXIT") -- quit service coroutine_yield "QUIT" diff --git a/skynet-src/skynet_server.c b/skynet-src/skynet_server.c index 4cc726e3..9f2a3593 100644 --- a/skynet-src/skynet_server.c +++ b/skynet-src/skynet_server.c @@ -118,7 +118,7 @@ drop_message(struct skynet_message *msg, void *ud) { uint32_t source = d->handle; assert(source); // report error to the message source - skynet_send(NULL, source, msg->source, PTYPE_ERROR, 0, NULL, 0); + skynet_send(NULL, source, msg->source, PTYPE_ERROR, msg->session, NULL, 0); } struct skynet_context *