if(CONFIG_LOG_MSG) writeLog("Received Service Registration\n" + msg.toString());
logMessage("Received Message:", msg);
    private SLPMessageHeader handleServiceRegistration(SLPInputStream sis, boolean isUDP) {        SLPSrvRegMessage msg = new SLPSrvRegMessage();        SLPMessageHeader reply = null;        int error = 0;        try {            msg.fromInputStream(sis);        }catch(ServiceLocationException sle) {            error = sle.getErrorCode();        }                if(CONFIG_LOG_MSG) writeLog("Received Service Registration\n" + msg.toString());                // handle registration        if(error == 0) {            Vector s = SLPUtil.findCommonScopes(supportedScopes, msg.getScopes());            if(msg.getScopes().size() == s.size()) {                // register message.                if( (msg.getFlags() & SLPMessageHeader.FLAG_FRESH) != 0) {                    SLPDatabaseEntry newReg = new SLPDatabaseEntry(msg.getURL(),                                                                   msg.getAttributes(),                                                                   msg.getScopes(),                                                                   msg.getLanguage());                    database.removeEntry(newReg);                    database.addEntry(newReg);                }                else {                    // currently only handle fresh registrations...                    error = ServiceLocationException.INVALID_REGISTRATION;                }            }            else {                error = ServiceLocationException.SCOPE_NOT_SUPPORTED;            }        }        reply = new SLPSrvAckMessage(error, msg.getLanguage());        reply.setXID(msg.getXID());                return reply;    }