diff --git a/src/Worker.php b/src/Worker.php index 89e5d98c..7c542b6e 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);