if(owner.CONFIG_LOG_ERRORS) owner.writeLog("Wrong SLP Version number: " + version);
owner.logError("Wrong SLP Version number: " + version, null);
    public synchronized boolean udpReceived(DatagramPacket packet) {        // received a reply.        // read version and function, call SLPAgent.handleReplyMessage(...)        // create input stream. Check version.        int version = 0;        int function = 0;        SLPInputStream sis = new SLPInputStream((InputStream)(new ByteArrayInputStream(packet.getData())));        try {            version = sis.readByte();            function = sis.readByte();        }catch(IOException ioe) {            function = version = 0; // this packet will not be handled.        }        // check that version == 2. We only support version 2 of the SLP.        if(version != 2) {            function = 0; // packet will be ignored            if(owner.CONFIG_LOG_ERRORS) owner.writeLog("Wrong SLP Version number: " + version);        }                boolean complete = true;        try {            complete = owner.handleReplyMessage(function, sis, results);        }catch(ServiceLocationException e) {            // TODO            // Check error code. If internal system error: stop listening.            // Other errors are ignored. Write to log if configured to do so...            e.printStackTrace();        }        if(!complete) {            // need to try again with TCP...            if(owner.CONFIG_DEBUG) owner.writeLog("Received Message was truncated");            tcpTargets.add(new tcpHost(packet.getAddress(),                                       packet.getPort()));        }                        // if the current request was multicast, and we haven't waited too long,        // we continue listening for more replies.        if( ((theRequest.getFlags() & SLPMessageHeader.FLAG_MCAST) != 0x0) ) {            // add responder to responder list, and create new datagram.            SLPSrvReqMessage msg = (SLPSrvReqMessage)theRequest;            msg.addResponder(packet.getAddress().getHostAddress());            thePacket = SLPUtil.createDatagram(msg,                                               thePacket.getAddress(),                                               thePacket.getPort());            // We don't retransmit the request here, but wait for a timeout.            //return 0;            return true;        }        // if we get here, we are done with this request.        weAreDone();        //return 0;        return true;    }