stopServerSocket();
    public void down(Event evt) {        Address mbr, tmp_ping_dest;        View v;        switch(evt.getType()) {            case Event.UNSUSPECT:                bcast_task.removeSuspectedMember((Address)evt.getArg());                break;            case Event.CONNECT:                passDown(evt);                group_name=(String)evt.getArg();                srv_sock=Util.createServerSocket(bind_addr, start_port); // grab a random unused port above 10000                srv_sock_addr=new IpAddress(bind_addr, srv_sock.getLocalPort());                startServerSocket();                break;            case Event.DISCONNECT:                group_name=null;                String tmp, prefix=Global.THREAD_PREFIX;                int index;                tmp=srv_sock_handler != null? srv_sock_handler.getName() : null;                if(tmp != null) {                    index=tmp.indexOf(prefix);                    if(index > -1) {                        tmp=tmp.substring(0, index);                        srv_sock_handler.setName(tmp);                    }                }                synchronized(pinger_mutex) {                    tmp=pinger_thread != null? pinger_thread.getName() : null;                    if(tmp != null) {                        index=tmp.indexOf(prefix);                        if(index > -1) {                            tmp=tmp.substring(0, index);                            pinger_thread.setName(tmp);                        }                    }                }                break;            case Event.VIEW_CHANGE:                v=(View) evt.getArg();                Vector new_mbrs=v.getMembers();                passDown(evt);                synchronized(this) {                    members.removeAllElements();                    members.addAll(new_mbrs);                    bcast_task.adjustSuspectedMembers(members);                    pingable_mbrs.removeAllElements();                    pingable_mbrs.addAll(members);                    if(log.isDebugEnabled()) log.debug("VIEW_CHANGE received: " + members);                    // 1. Get the addr:pid cache from the coordinator (only if not already fetched)                    if(!got_cache_from_coord) {                        getCacheFromCoordinator();                        got_cache_from_coord=true;                    }                    // 2. Broadcast my own addr:sock to all members so they can update their cache                    if(!srv_sock_sent) {                        if(srv_sock_addr != null) {                            sendIHaveSockMessage(null, // send to all members                                    local_addr,                                    srv_sock_addr);                            srv_sock_sent=true;                        }                        else                            if(warn) log.warn("(VIEW_CHANGE): srv_sock_addr == null");                    }                    // 3. Remove all entries in 'cache' which are not in the new membership                    for(Enumeration e=cache.keys(); e.hasMoreElements();) {                        mbr=(Address) e.nextElement();                        if(!members.contains(mbr))                            cache.remove(mbr);                    }                    if(members.size() > 1) {                        synchronized(pinger_mutex) {                            if(pinger_thread != null && pinger_thread.isAlive()) {                                tmp_ping_dest=determinePingDest();                                if(ping_dest != null && tmp_ping_dest != null && !ping_dest.equals(tmp_ping_dest)) {                                    interruptPingerThread(); // allows the thread to use the new socket                                }                            }                            else                                startPingerThread(); // only starts if not yet running                        }                    }                    else {                        ping_dest=null;                        stopPingerThread();                    }                }                break;            default:                passDown(evt);                break;        }    }