public void connect(){
        
        KaiConfig config = JKaiUI.getConfig();
        
        _logger.fine("Discovering engine");
        if(config.getConfigBoolean(AUTOMATICALLYDETECTED)) {
            
            EngineFinder finder = new EngineFinder();
            
            // SPLASH SCREEN WOULD BE GOOD HERE!!!
            // Finding engines. Note: the argument given is the number of SECONDS to timeout
            finder.spawnEngineReceivers(2);
            
            Collection engines = finder.getEngines();
            if(engines.size() == 0) {
                boolean shouldRetry = JKaiUI.getMainUI().askRetry("MSG_NoEngineFound", "MSG_NoEngineFoundTitleMsg");
                if(shouldRetry) {
                    JKaiUI.connect();
                }
                return;
            } else if(engines.size() == 1) {
                Iterator it = engines.iterator();
                conn = new Connection((String)it.next(), 34522);
            } else {
                String[] engineArray = new String[engines.size()];
                
                // Fill the array using the Collection's iterator
                Iterator it = engines.iterator();
                int traverseIndex = 0;
                while(it.hasNext()) engineArray[traverseIndex++] = (String) it.next();
                
                String choice = JKaiUI.getMainUI().openEnginePrompt(engineArray);
                
                if(choice == null) return;
                
                conn = new Connection(choice, 34522);
            }
            
        } else {
            // User wants to manually specify a host and port
            
            conn = new Connection(config.getConfigString(HOST), config.getConfigInt(PORT));
        }
        
        executer.execute(new DiscoverEngine());
        
    }