فهرست منبع

Update AsyncTcpConnection.php

walkor 7 سال پیش
والد
کامیت
b70b5142ea
1فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 13 2
      Connection/AsyncTcpConnection.php

+ 13 - 2
Connection/AsyncTcpConnection.php

@@ -75,7 +75,7 @@ class AsyncTcpConnection extends TcpConnection
     /**
      * Context option.
      *
-     * @var resource
+     * @var array
      */
     protected $_contextOption = null;
 
@@ -213,7 +213,8 @@ class AsyncTcpConnection extends TcpConnection
      * @param int $after
      * @return void
      */
-    public function reConnect($after = 0) {
+    public function reconnect($after = 0)
+    {
         $this->_status                   = self::STATUS_INITIAL;
         static::$connections[$this->_id] = $this;
         if ($this->_reconnectTimer) {
@@ -227,6 +228,16 @@ class AsyncTcpConnection extends TcpConnection
     }
 
     /**
+     * CancelReconnect.
+     */
+    public function cancelReconnect()
+    {
+        if ($this->_reconnectTimer) {
+            Timer::del($this->_reconnectTimer);
+        }
+    }
+
+    /**
      * Get remote address.
      *
      * @return string