From 5a0e147c2b5af9c623c0b486949df8942d97ca02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 19 Aug 2021 19:18:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Abstracts/CustomProcess.php | 62 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Server/Abstracts/CustomProcess.php b/Server/Abstracts/CustomProcess.php index 0920d783..9c741eff 100644 --- a/Server/Abstracts/CustomProcess.php +++ b/Server/Abstracts/CustomProcess.php @@ -45,37 +45,37 @@ abstract class CustomProcess implements \Server\SInterface\CustomProcess */ public function signListen(Process $process): void { - if (Coroutine::getCid() === -1) { - Process::signal(SIGTERM | SIGKILL, function ($signo) use ($process) { - if ($signo) { - $lists = Kiri::app()->getProcess(); - foreach ($lists as $process) { - $process->exit(0); - } - } - }); - } else { - Coroutine::create(function () use ($process) { - /** @var Coroutine\Socket $message */ - $message = $process->exportSocket(); - if ($message->recv() == 0x03455343213212) { - $this->waiteExit($process); - } - }); - Coroutine::create(function () use ($process) { - $data = Coroutine::waitSignal(SIGTERM | SIGKILL, -1); - if ($data) { - $lists = Kiri::app()->getProcess(); - foreach ($lists as $name => $process) { - foreach ($process as $item) { - /** @var Coroutine\Socket $export */ - $export = $item->exportSocket(); - $export->send(0x03455343213212); - } - } - } - }); - } +// if (Coroutine::getCid() === -1) { +// Process::signal(SIGTERM | SIGKILL, function ($signo) use ($process) { +// if ($signo) { +// $lists = Kiri::app()->getProcess(); +// foreach ($lists as $process) { +// $process->exit(0); +// } +// } +// }); +// } else { +// Coroutine::create(function () use ($process) { +// /** @var Coroutine\Socket $message */ +// $message = $process->exportSocket(); +// if ($message->recv() == 0x03455343213212) { +// $this->waiteExit($process); +// } +// }); +// Coroutine::create(function () use ($process) { +// $data = Coroutine::waitSignal(SIGTERM | SIGKILL, -1); +// if ($data) { +// $lists = Kiri::app()->getProcess(); +// foreach ($lists as $name => $process) { +// foreach ($process as $item) { +// /** @var Coroutine\Socket $export */ +// $export = $item->exportSocket(); +// $export->send(0x03455343213212); +// } +// } +// } +// }); +// } }