log.error("-- message received (" + tmp + ") is not 1 greater than " + current_value);
System.err.println("-- message received (" + tmp + ") is not 1 greater than " + current_value);
    public void run() {        Data data;        Message msg;        Object obj;        boolean started=false;        long start=0, stop=0;        long current_value=0, tmp=0, num_values=0;        long total_msgs=0, total_time=0, msgs_per_sec;        while(true) {            try {                obj=channel.receive(0);                if(obj instanceof View)                    System.out.println("** view: " + obj);                else                    if(obj instanceof Message) {                        msg=(Message)obj;                        data=(Data)msg.getObject();                        if(data instanceof StartData) {                            if(started) {                                log.error("UnicastTest.run(): received START data, but am already processing data");                                continue;                            }                            else {                                started=true;                                current_value=0; // first value to be received                                tmp=0;                                num_values=((StartData)data).num_values;                                start=System.currentTimeMillis();                            }                        }                        else                            if(data instanceof Value) {                                tmp=((Value)data).value;                                if(current_value + 1 != tmp) {                                    log.error("-- message received (" + tmp + ") is not 1 greater than " + current_value);                                }                                else {                                    current_value++;                                    if(current_value % 100 == 0)                                        System.out.println("received " + current_value);                                    if(current_value >= num_values) {                                        stop=System.currentTimeMillis();                                        total_time=stop - start;                                        msgs_per_sec=(long)(num_values / (total_time / 1000.0));                                        System.out.println("-- received " + num_values + " messages in " + total_time +                                                           " ms (" + msgs_per_sec + " messages/sec)");                                        started=false;                                        if(exit_on_end)                                            System.exit(0);                                        continue;                                    }                                }                            }                    }            }            catch(ChannelNotConnectedException not_connected) {                log.error(not_connected);                break;            }            catch(ChannelClosedException closed_ex) {                log.error(closed_ex);                break;            }            catch(TimeoutException timeout) {                log.error(timeout);                break;            }            catch(Throwable t) {                log.error(t);                started=false;                current_value=0;                tmp=0;                Util.sleep(1000);            }        }        // System.out.println("UnicastTest.run(): receiver thread terminated");    }