浏览代码

Update TcpConnection.php

walkor 4 年之前
父节点
当前提交
ab9a28b03c
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Connection/TcpConnection.php

+ 3 - 0
Connection/TcpConnection.php

@@ -469,6 +469,9 @@ class TcpConnection extends ConnectionInterface
      */
      */
     public function getLocalAddress()
     public function getLocalAddress()
     {
     {
+        if (!\is_resource($this->_socket)) {
+            return '';
+        }
         return (string)@\stream_socket_get_name($this->_socket, false);
         return (string)@\stream_socket_get_name($this->_socket, false);
     }
     }