From e562b07c25960f2cdad1b3c4aeee2c784ca2d884 Mon Sep 17 00:00:00 2001 From: walkor Date: Sun, 17 Dec 2023 09:57:17 +0800 Subject: [PATCH] save --- src/Connection/AsyncTcpConnection.php | 2 +- src/Connection/TcpConnection.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Connection/AsyncTcpConnection.php b/src/Connection/AsyncTcpConnection.php index 25b53d195..e88b2c098 100644 --- a/src/Connection/AsyncTcpConnection.php +++ b/src/Connection/AsyncTcpConnection.php @@ -365,7 +365,7 @@ public function getRemoteURI(): string public function checkConnection(): void { // Remove EV_EXPECT for windows. - if (DIRECTORY_SEPARATOR === '\\' && $this->eventLoop && method_exists($this->eventLoop, 'offExcept')) { + if (DIRECTORY_SEPARATOR === '\\' && method_exists($this->eventLoop, 'offExcept')) { $this->eventLoop->offExcept($this->socket); } // Remove write listener. diff --git a/src/Connection/TcpConnection.php b/src/Connection/TcpConnection.php index c5a0b81e7..96a7a023b 100644 --- a/src/Connection/TcpConnection.php +++ b/src/Connection/TcpConnection.php @@ -1002,6 +1002,9 @@ public function destroy(): void // Remove event listener. $this->eventLoop->offReadable($this->socket); $this->eventLoop->offWritable($this->socket); + if (DIRECTORY_SEPARATOR === '\\' && method_exists($this->eventLoop, 'offExcept')) { + $this->eventLoop->offExcept($this->socket); + } // Close socket. try {