log.fatal("local_addr == null; cannot connect");
log.fatal("local_addr is null; cannot connect");
    public synchronized void connect(String channel_name) throws ChannelException, ChannelClosedException {        /*make sure the channel is not closed*/        checkClosed();        /*if we already are connected, then ignore this*/        if(connected) {            if(log.isErrorEnabled()) log.error("already connected to " + channel_name);            return;        }        /*make sure we have a valid channel name*/        if(channel_name == null) {            if(log.isInfoEnabled()) log.info("channel_name is null, assuming unicast channel");        }        else            this.channel_name=channel_name;        try {            prot_stack.startStack(); // calls start() in all protocols, from top to bottom        }        catch(Throwable e) {            if(log.isErrorEnabled()) log.error("exception: " + e);            throw new ChannelException(e.toString());        }        /* try to get LOCAL_ADDR_TIMEOUT. Catch SecurityException thrown if called         * in an untrusted environment (e.g. using JNLP) */        try {            LOCAL_ADDR_TIMEOUT=Long.parseLong(System.getProperty("local_addr.timeout","30000"));        }        catch (SecurityException e1) {            /* Use the default value specified above*/        }		/* Wait LOCAL_ADDR_TIMEOUT milliseconds for local_addr to have a non-null value (set by SET_LOCAL_ADDRESS) */        synchronized(local_addr_mutex) {            long wait_time=LOCAL_ADDR_TIMEOUT, start=System.currentTimeMillis();            while(local_addr == null && wait_time > 0) {                try {                    local_addr_mutex.wait(wait_time);                }                catch(InterruptedException ex) {                    ;                }                wait_time-=System.currentTimeMillis() - start;            }        }        // ProtocolStack.start() must have given us a valid local address; if not we won't be able to continue        if(local_addr == null) {            log.fatal("local_addr == null; cannot connect");            throw new ChannelException("local_addr is null");        }        /*create a temporary view, assume this channel is the only member and         *is the coordinator*/        Vector t=new Vector(1);        t.addElement(local_addr);        my_view=new View(local_addr, 0, t);  // create a dummy view        // only connect if we are not a unicast channel        if(channel_name != null) {            /* Wait for notification that the channel has been connected to the group */            synchronized(connect_mutex) {             // wait for CONNECT_OK event                Event connect_event=new Event(Event.CONNECT, channel_name);                connect_ok_event_received=false; // added patch by Roland Kurman (see history.txt)                down(connect_event);                try {                    while(!connect_ok_event_received)                        connect_mutex.wait();                }                catch(Exception e) {                }            }        }        /*notify any channel listeners*/        connected=true;        if(channel_listener != null)            channel_listener.channelConnected(this);    }