|
|
@@ -388,7 +388,7 @@ class AsyncTcpConnection extends TcpConnection
|
|
|
$socket = socket_import_stream($this->socket);
|
|
|
socket_set_option($socket, SOL_SOCKET, SO_KEEPALIVE, 1);
|
|
|
socket_set_option($socket, SOL_TCP, TCP_NODELAY, 1);
|
|
|
- if (defined('TCP_KEEPIDLE')) {
|
|
|
+ if (defined('TCP_KEEPIDLE') && defined('TCP_KEEPINTVL') && defined('TCP_KEEPCNT')) {
|
|
|
socket_set_option($socket, SOL_TCP, TCP_KEEPIDLE, static::TCP_KEEPALIVE_INTERVAL);
|
|
|
socket_set_option($socket, SOL_TCP, TCP_KEEPINTVL, static::TCP_KEEPALIVE_INTERVAL);
|
|
|
socket_set_option($socket, SOL_TCP, TCP_KEEPCNT, 1);
|