protected Address getCoordinator(Message msg, GMS.GmsHeader hdr) {
        switch(hdr.getType()) {
            case GMS.GmsHeader.JOIN_RSP:
                try {
                    JoinRsp join_rsp=Util.streamableFromBuffer(JoinRsp.class, msg.getRawBuffer(), msg.getOffset(), msg.getLength());
                    View new_view=join_rsp != null? join_rsp.getView() : null;
                    return new_view != null? new_view.getCoord() : null;
                }
                catch(Throwable t) {
                    log.error("%s: failed getting coordinator (keyserver) from JoinRsp: %s", local_addr, t);
                }
                break;
            case GMS.GmsHeader.INSTALL_MERGE_VIEW:
                try {
                    Tuple<View,Digest> tuple=GMS._readViewAndDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength());
                    View new_view=tuple != null? tuple.getVal1() : null;
                    return new_view != null? new_view.getCoord() : null;
                }
                catch(Throwable t) {
                    log.error("%s: failed getting coordinator (keyserver) from INSTALL_MERGE_VIEW: %s", local_addr, t);
                }
                break;
        }
        return null;
    }