if(CONFIG_LOG_MSG) { String dbgMsg = "Received Service Request:\n" + msg.toString() + "\n"; if(reply != null) dbgMsg += "Sending Reply:\n" + reply.toString(); else dbgMsg += "Not Sending Reply";  writeLog(dbgMsg); }
    private SLPMessageHeader recvSrvReqMessage(SLPInputStream sis, boolean isUDP) {        int error = 0;        SLPSrvReqMessage msg = new SLPSrvReqMessage();        try {            msg.fromInputStream(sis);            // if we have replied to this message before: do nothing.            if(msg.getPRList().indexOf(address.getHostAddress()) != -1) {                return null; //have replied before...            }        }catch(ServiceLocationException e) {            e.printStackTrace();            error = e.getErrorCode();        }        if(error == 0) {            // check that at least one requested scope is supported.            if(msg.getScopes().isEmpty() || SLPUtil.supportScopes(supportedScopes, msg.getScopes())) {                // handle service:service-agent requests here...                if(msg.getServiceType().toString().equalsIgnoreCase(SA_TYPE)) {                    return handleSAAdvertReq(msg);                }            }            else {                error = ServiceLocationException.SCOPE_NOT_SUPPORTED;            }        }//error                SLPMessageHeader reply = SLPRequestHandlers.handleServiceRequest(database,                                                                         msg,                                                                         error,                                                                         CONFIG_SLP_MTU,                                                                         isUDP);        if(CONFIG_LOG_MSG) {            String dbgMsg = "Received Service Request:\n" + msg.toString() + "\n";            if(reply != null) dbgMsg += "Sending Reply:\n" + reply.toString();            else dbgMsg += "Not Sending Reply";                        writeLog(dbgMsg);        }                return reply;    }