           check()
 
 
-    # 长轮训
+    # 长轮询
     # @callback
     runloop: (callback)->
       @api.long_poll @auth , (ret,e)=>


    # 自杀
    die: (message,info)->
        log.error "QQBot die! message: #{message}" if message
        log.error "QQBot die! info #{JSON.stringify info}" if info
        process.exit(1)

    # 处理poll返回的内容

      switch code
        when -1  then log.error "resp is null"
        when 0   then @_handle_poll_event(event) for event in resp.result
        when 102 then 'nothing happened'
        when 103 then '应该是token失效了，但是偶尔也有情况返回' ; @die("登录异常 #{code}",resp)
        when 116 then @_update_ptwebqq(resp)
        when 121 then @die("登录异常 #{code}",resp)
        else log.debug resp

    # token改变后的通知
    # callback( @auth )
    on_token_changed: (callback)->
      @cb_token_changed = callback
      
    # 更新token ptwebqq的值，返回值{116 ,p=token}
    # TODO 看看cookie是否也需要修改
    _update_ptwebqq: (ret)->
      @auth['ptwebqq'] = ret.p
      @cb_token_changed(@auth)


    _handle_poll_event : (event) ->
