if(log.isInfoEnabled()) log.info("who-has-sock " + hdr.mbr);
if(log.isDebugEnabled()) log.debug("who-has-sock " + hdr.mbr);
    public void up(Event evt) {        Message msg;        FdHeader hdr=null;        Object tmphdr;        switch(evt.getType()) {            case Event.SET_LOCAL_ADDRESS:                local_addr=(Address) evt.getArg();                break;            case Event.MSG:                msg=(Message) evt.getArg();                tmphdr=msg.getHeader(getName());                if(tmphdr == null || !(tmphdr instanceof FdHeader))                    break;  // message did not originate from FD_SOCK layer, just pass up                hdr=(FdHeader) msg.removeHeader(getName());                switch(hdr.type) {                    case FdHeader.SUSPECT:                        if(hdr.mbrs != null) {                                if(log.isInfoEnabled()) log.info("[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(log.isWarnEnabled()) 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(log.isInfoEnabled()) log.info("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(log.isInfoEnabled()) log.info("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.cache=(Hashtable) cache.clone();                        msg=new Message(hdr.mbr, null, null);                        msg.putHeader(getName(), hdr);                        passDown(new Event(Event.MSG, msg));                        break;                    case FdHeader.GET_CACHE_RSP:                        if(hdr.cache == null) {                                if(log.isErrorEnabled()) log.error("(GET_CACHE_RSP): cache is null");                            return;                        }                        get_cache_promise.setResult(hdr.cache);                        break;                }                return;        }        passUp(evt);                                        // pass up to the layer above us    }