Browse Source

allow port defined as string

Jorge González 6 years ago
parent
commit
ee46acc8fd
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Network/Socket.php

+ 3 - 3
src/Network/Socket.php

@@ -162,9 +162,9 @@ class Socket
 
         set_error_handler([$this, '_connectionErrorHandler']);
         $remoteSocketTarget = $scheme . $this->_config['host'];
-        $port = $this->_config['port'];
-        if (is_int($port)) {
-            $remoteSocketTarget .= ':' . (int)$port;
+        $port = (int)$this->_config['port'];
+        if ($port > 0) {
+            $remoteSocketTarget .= ':' . $port;
         }
         $this->connection = stream_socket_client(
             $remoteSocketTarget,