From 9763a4ec01edc92f48e383bb643ee03dae104d8f Mon Sep 17 00:00:00 2001 From: Ben van Hartingsveldt Date: Tue, 10 Dec 2024 16:28:53 +0100 Subject: [PATCH] Add timeout --- src/Connections/EPPTCPConnection.php | 2 +- test.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test.php diff --git a/src/Connections/EPPTCPConnection.php b/src/Connections/EPPTCPConnection.php index d5abd64..941a9f8 100644 --- a/src/Connections/EPPTCPConnection.php +++ b/src/Connections/EPPTCPConnection.php @@ -60,7 +60,7 @@ public function isClosed(): bool{ public function open(): bool{ $host = $this->registry->getHost(); $hostname = parse_url($host,PHP_URL_SCHEME).'://'.parse_url($host,PHP_URL_HOST); - $this->socket = fsockopen($hostname,$this->registry->getPort()); + $this->socket = fsockopen($hostname,$this->registry->getPort(),$errCode,$errMsg,5); return $this->socket!==false; } diff --git a/test.php b/test.php new file mode 100644 index 0000000..64ef49f --- /dev/null +++ b/test.php @@ -0,0 +1,9 @@ +