From fe9999d30b7389ba39caa101ef02608db5025697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Fri, 20 May 2022 01:28:18 +0200 Subject: [PATCH] Avoid unneeded syscall on socket close --- src/Connection.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index 5e3b00d9..65ae26b4 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -127,13 +127,9 @@ public function handleClose() } // Try to cleanly shut down socket and ignore any errors in case other - // side already closed. Shutting down may return to blocking mode on - // some legacy versions, so reset to non-blocking just in case before - // continuing to close the socket resource. - // Underlying Stream implementation will take care of closing file - // handle, so we otherwise keep this open here. + // side already closed. Underlying Stream implementation will take care + // of closing stream resource, so we otherwise keep this open here. @\stream_socket_shutdown($this->stream, \STREAM_SHUT_RDWR); - \stream_set_blocking($this->stream, false); } public function getRemoteAddress()