From 75e266b0b97c72fa4eb8e4d29cc277f2be7ffbae Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Sat, 16 Nov 2024 13:29:31 +0100 Subject: [PATCH] Update Worker.php with TCP_KEEPIDLE Fix #1071 Changed validation. --- src/Worker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Worker.php b/src/Worker.php index 89e5d98c6..7c542b6e5 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -2351,7 +2351,7 @@ public function listen(): void $socket = socket_import_stream($this->mainSocket); socket_set_option($socket, SOL_SOCKET, SO_KEEPALIVE, 1); socket_set_option($socket, SOL_TCP, TCP_NODELAY, 1); - if (PHP_VERSION_ID >= 80200) { + if (defined('TCP_KEEPIDLE')) { socket_set_option($socket, SOL_TCP, TCP_KEEPIDLE, TcpConnection::TCP_KEEPALIVE_INTERVAL); socket_set_option($socket, SOL_TCP, TCP_KEEPINTVL, TcpConnection::TCP_KEEPALIVE_INTERVAL); socket_set_option($socket, SOL_TCP, TCP_KEEPCNT, 1);