From 5cf1a12e77f2a340817d7dcd40a7bcfd7b5c5a08 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 19 May 2015 18:23:08 +0800 Subject: [PATCH] update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dcf4e5f..0b1a064 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ ws.connect('ws://127.0.0.1:8080',function(handlers,evn){ //连接成功! },function(handlers,evn){ //关闭触发! + if(handlers.closeType === "kick"){ + console.log('这个是踢下线!的关闭!') + } },function(handlers,evn){ //连接失败! }) @@ -38,10 +41,10 @@ ws.send('{}') //=>handlers ``` ### 关闭连接的监听器 -//ws.disconnect(callback) +//ws.disconnect(type,callback) 关闭类型 ```js -ws.disconnect(function(data){ +ws.disconnect("kick",function(data){ }) ```