public void connect() {
    int iPort = 6667;
    if (wikimediaBot == null || !wikimediaBot.isConnected()) {
      try {
        iPort = Integer.parseInt(port);
      } catch (Exception e) {
        System.out.println("IRC.java, problem parsing integer: "
            + e.getMessage());
      }

      String[] channels = wikimediaChannels.split(",");

      if (wikimediaBot == null)
        wikimediaBot = new MediawikiBot(server, iPort, nick, channels, mediawikiEnc, data, listener);
      else
        wikimediaBot.setValues(server, iPort, nick, channels, mediawikiEnc, data, listener);
      wikimediaBot.connect();
    }

    if ((freenodeBot == null || !freenodeBot.isConnected()) && checkFreenodeBoxes()) {
      String freenodeNick = config.getProperty("FreenodeNick");
      if (freenodeNick == null || freenodeNick.trim().length() == 0)
        freenodeNick = createNick();
      freenodeBot = new FreenodeBot("irc.freenode.org", iPort, freenodeNick, freenodeEnc, data, listener);
      joinFreenodeChannels();
      freenodeBot.connect();
    }
  }