示例#1
0
文件: Bot.java 项目: cmsd2/elsie
  public synchronized void disconnect(String reason) throws IOException {
    log.info("Disconnecting");
    for (IChannel c : channels) {
      c.part();
    }
    log.info("Closing server connection");
    sender.write(irc.quit(reason));
    sender.flush();

    sender.close();
    receiver.close();

    if (!connection.isClosed()) {
      connection.close();
    }
  }