if(len == 1 && data[0] == 0) { if(log.isTraceEnabled()) log.trace("received dummy packet"); continue; }
        public void run() {            DatagramPacket  packet;            byte            receive_buf[]=new byte[65535];            int             len;            byte[]          data, tmp;            InetAddress     sender_addr;            int             sender_port;            // moved out of loop to avoid excessive object creations (bela March 8 2001)            packet=new DatagramPacket(receive_buf, receive_buf.length);            while(running && thread != null && sock != null) {                try {                    packet.setData(receive_buf, 0, receive_buf.length);                    sock.receive(packet);                    sender_addr=packet.getAddress();                    sender_port=packet.getPort();                    len=packet.getLength();                    data=packet.getData();                    if(len == 1 && data[0] == 0) {                        if(log.isTraceEnabled()) log.trace("received dummy packet");                        continue;                    }                    if(log.isTraceEnabled())                        log.trace("received (ucast) " + len + " bytes from " + sender_addr + ':' + sender_port);                    if(len > receive_buf.length) {                        if(log.isErrorEnabled())                            log.error("size of the received packet (" + len + ") is bigger than allocated buffer (" +                                      receive_buf.length + "): will not be able to handle packet. " +                                      "Use the FRAG protocol and make its frag_size lower than " + receive_buf.length);                    }                    if(Version.compareTo(data) == false) {                        if(log.isWarnEnabled()) {                            StringBuffer sb=new StringBuffer();                            sb.append("packet from ").append(sender_addr).append(':').append(sender_port);                            sb.append(" has different version (").append(Version.printVersionId(data, Version.version_id.length));                            sb.append(") from ours (").append(Version.printVersionId(Version.version_id)).append("). ");                            if(discard_incompatible_packets)                                sb.append("Packet is discarded");                            else                                sb.append("This may cause problems");                            log.warn(sb.toString());                        }                        if(discard_incompatible_packets)                            continue;                    }                    if(use_incoming_packet_handler) {                        tmp=new byte[len];                        System.arraycopy(data, 0, tmp, 0, len);                        incoming_queue.add(new IncomingQueueEntry(local_addr, sender_addr, sender_port, tmp));                    }                    else                        handleIncomingUdpPacket(local_addr, sender_addr, sender_port, data);                }                catch(SocketException sock_ex) {                    if(log.isDebugEnabled()) log.debug("unicast receiver socket is closed, exception=" + sock_ex);                    break;                }                catch(InterruptedIOException io_ex) { // thread was interrupted                    ; // go back to top of loop, where we will terminate loop                }                catch(Throwable ex) {                    if(log.isErrorEnabled())                        log.error("[" + local_addr + "] failed receiving unicast packet", ex);                    Util.sleep(100); // so we don't get into 100% cpu spinning (should NEVER happen !)                }            }            if(log.isDebugEnabled()) log.debug("unicast receiver thread terminated");        }