if(CONFIG_LOG_ERRORS) writeLog("Error parsing message: " + e.toString()); e.printStackTrace();
logError("Error parsing message: ", e);
    public boolean udpReceived(DatagramPacket packet) {        // create input stream, and check version.        SLPInputStream sis = new SLPInputStream(new ByteArrayInputStream(packet.getData()));        int version = 0;        int function = 0;        try {            version = sis.readByte();            function = sis.readByte();        }catch(IOException ioe) {            version = function = 0;        }        if(version != 2) {            // unsupported version            handleUnsupportedVersion(sis, packet);        }        else {            try {                SLPMessageHeader reply = handleNonReplyMessage(function, sis, true);                if(reply != null) {                    if(CONFIG_LOG_MSG) writeLog("Sending Reply\n" + reply.toString());                    sendServiceReply(reply, packet.getAddress(), packet.getPort());                }            }catch(ServiceLocationException e) {                if(CONFIG_LOG_ERRORS) writeLog("Error parsing message: " + e.toString());                e.printStackTrace();            }        }                //return 0;        return true;    }