case Event.CONFIG: Map config=(Map)evt.getArg(); transport_bind_addr=(InetAddress)config.get("bind_addr"); break;
    public void up(Event evt) {        Message msg;        FdHeader hdr;        switch(evt.getType()) {        case Event.SET_LOCAL_ADDRESS:            local_addr=(Address) evt.getArg();            break;        case Event.MSG:            msg=(Message) evt.getArg();            hdr=(FdHeader) msg.removeHeader(name);            if(hdr == null)                break;  // message did not originate from FD_SOCK layer, just pass up            switch(hdr.type) {            case FdHeader.SUSPECT:                if(hdr.mbrs != null) {                    if(log.isDebugEnabled()) log.debug("[SUSPECT] hdr=" + hdr);                    for(int i=0; i < hdr.mbrs.size(); i++) {                        passUp(new Event(Event.SUSPECT, hdr.mbrs.elementAt(i)));                        passDown(new Event(Event.SUSPECT, hdr.mbrs.elementAt(i)));                    }                }                else                    if(warn) log.warn("[SUSPECT]: hdr.mbrs == null");                break;                // If I have the sock for 'hdr.mbr', return it. Otherwise look it up in my cache and return it            case FdHeader.WHO_HAS_SOCK:                if(local_addr != null && local_addr.equals(msg.getSrc()))                    return; // don't reply to WHO_HAS bcasts sent by me !                if(hdr.mbr == null) {                    if(log.isErrorEnabled()) log.error("hdr.mbr is null");                    return;                }                if(trace) log.trace("who-has-sock " + hdr.mbr);                // 1. Try my own address, maybe it's me whose socket is wanted                if(local_addr != null && local_addr.equals(hdr.mbr) && srv_sock_addr != null) {                    sendIHaveSockMessage(msg.getSrc(), local_addr, srv_sock_addr);  // unicast message to msg.getSrc()                    return;                }                // 2. If I don't have it, maybe it is in the cache                if(cache.containsKey(hdr.mbr))                    sendIHaveSockMessage(msg.getSrc(), hdr.mbr, (IpAddress) cache.get(hdr.mbr));  // ucast msg                break;                // Update the cache with the addr:sock_addr entry (if on the same host)            case FdHeader.I_HAVE_SOCK:                if(hdr.mbr == null || hdr.sock_addr == null) {                    if(log.isErrorEnabled()) log.error("[I_HAVE_SOCK]: hdr.mbr is null or hdr.sock_addr == null");                    return;                }                // if(!cache.containsKey(hdr.mbr))                cache.put(hdr.mbr, hdr.sock_addr); // update the cache                if(trace) log.trace("i-have-sock: " + hdr.mbr + " --> " +                                                   hdr.sock_addr + " (cache is " + cache + ')');                if(ping_dest != null && hdr.mbr.equals(ping_dest))                    ping_addr_promise.setResult(hdr.sock_addr);                break;                // Return the cache to the sender of this message            case FdHeader.GET_CACHE:                if(hdr.mbr == null) {                    if(log.isErrorEnabled()) log.error("(GET_CACHE): hdr.mbr == null");                    return;                }                hdr=new FdHeader(FdHeader.GET_CACHE_RSP);                hdr.cachedAddrs=(Hashtable) cache.clone();                msg=new Message(hdr.mbr, null, null);                msg.putHeader(name, hdr);                passDown(new Event(Event.MSG, msg));                break;            case FdHeader.GET_CACHE_RSP:                if(hdr.cachedAddrs == null) {                    if(log.isErrorEnabled()) log.error("(GET_CACHE_RSP): cache is null");                    return;                }                get_cache_promise.setResult(hdr.cachedAddrs);                break;            }            return;        }        passUp(evt);                                        // pass up to the layer above us    }