if(CONFIG_LOG_ERRORS) writeLog("Wrong SLP Version number: " + version);
logError("Wrong SLP Version number: " + version, null);
    public boolean udpReceived(DatagramPacket packet) {        // create input stream. Check version.        int version = 0;        int function = 0;        ByteArrayInputStream bais = new ByteArrayInputStream(packet.getData());        SLPInputStream sis = new SLPInputStream(bais);        try {            version = sis.readByte();            function = sis.readByte();        }catch(IOException ioe) {            function = version = 0; // this packet will not be handled.            ioe.printStackTrace();        }        // check that version == 2. We only support version 2 of the SLP.        if(version != 2) {            function = 0; // packet will be ignored            if(CONFIG_LOG_ERRORS) writeLog("Wrong SLP Version number: " + version);        }        SLPMessageHeader msgReply = null;        try {            msgReply = handleNonReplyMessage(function, sis, true);        }catch(ServiceLocationException e) {            e.printStackTrace();        }                if(msgReply != null) {            try {                if(CONFIG_DEBUG) System.out.println("address: " + packet.getAddress() + " - port: " + packet.getPort());                DatagramPacket toSend = SLPUtil.createDatagram(msgReply, packet.getAddress(), packet.getPort());                unicastCommunicator.send(toSend);                if(CONFIG_DEBUG) System.out.println("ServiceAgent -> Reply sent!");            }catch(Exception e) { e.printStackTrace(); }        }        //return 0;         return true;    }