stop method

void stop()

停止Socket

Implementation

void stop() {
  try {
    started = false;
    timerPing?.cancel();
    checkNetWorkStatus?.cancel();
    imWebsocket!.isLogin = false;
    imWebsocket!.started = started;
    imWebsocket!.disconnect();
    checkNetWorkStatus = null;
    timerPing = null;
    WidgetsBinding.instance.removeObserver(this);
    Logger.info("Socket已停止");
  }catch(e){
    eventBus.emit("immessage",IMManagerSubject(e.toString(),"ERROR"));
  }
}