} catch (Exception e) { System.out.println ( "Problem starting one of your hosts." ); System.out.println ("Startup was: dx -optimize memory -execonly -processors 1 -highlight off :" + host); System.exit( 1 ); } if (dxlcon == 0) { System.out.println ( "Problem starting one of your hosts." ); System.out.println ("Startup was: dx -optimize memory -execonly -processors 1 -highlight off :" + host); System.exit( 1 ); }
    public static Long NewConnection( DXServerThread dxst, String path )    {        ConnectionEntry ce = null;        synchronized ( DXServer.CachedConns ) {            if ( DXServer.CachedConns.size() > 0 ) {                ConnectionEntry minEntry = null;                Enumeration enum1 = CachedConns.elements();                while ( enum1.hasMoreElements() ) {                    ConnectionEntry existing = ( ConnectionEntry ) enum1.nextElement();                    if ( existing.isFailed() ) {}                    else if ( minEntry == null ) {                        minEntry = existing;                    }                    else if ( existing.getUserCount() < minEntry.getUserCount() ) {                        minEntry = existing;                    }                    else if ( existing.getUserCount() == minEntry.getUserCount() ) {                        if ( existing.getUserTime() < minEntry.getUserTime() ) {                            minEntry = existing;                        }                    }                    if ( ( minEntry != null ) && ( minEntry.getUserCount() == 0 ) )                        break;                }                ce = minEntry;            }            boolean more_capacity = false;            if ( DXServer.GetMaxSessions() > DXServer.CachedConns.size() )                more_capacity = true;            if ( ( ce != null ) && ( ce.getUserCount() >= 1 ) && ( more_capacity ) )                ce = null;            if ( ce == null ) {                String host = DXServer.GetNextHost();                long dxlcon =                    DXServer.DXLStartDX( "dx -optimize memory -execonly -processors 1 -highlight off", host );                Long C = new Long( dxlcon );                ce = new ConnectionEntry( C );                CachedConns.put( C, ce );            }            if ( ce == null ) return null;            ce.attachUser( dxst, path );        }        return ce.getDXLConnection();    }