Browse Source

add close

Paul 5 years ago
parent
commit
062239b518
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/client.ts

+ 7
- 0
src/client.ts View File

221
     return '';
221
     return '';
222
   }
222
   }
223
 
223
 
224
+  /**
225
+   * 关闭客户端链接
226
+   */
227
+  public close(code?: number, reason?: string): void {
228
+    this.socket.close(code, reason);
229
+  }
230
+
224
   /**
231
   /**
225
    * 创建websocket链接
232
    * 创建websocket链接
226
    */
233
    */