Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1211

endless loop at SpeedTest

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • 2.10
    • 2.10
    • Low
    • Workaround Exists
    • Hide

      The solution is rather simple, at subclass Reciever add:

      run {
      ...
      if(jg) {
      obj=channel.receive(0);
      if(obj instanceof Message)

      { byte[] buffer = ((Message)obj).getBuffer(); in=new DataInputStream(new ByteArrayInputStream(buffer)); }

      else

      { System.out.println("received non-msg: " + obj.getClass()); continue; }

      }
      else

      { sock.receive(packet); in=new DataInputStream(new ByteArrayInputStream(buf)); }

      number=in.readInt();
      matrix[number][1]=1;

      if (num_received != number)

      { System.err.println(" lost packet "+ number); num_received = number; }

      ...
      num_received++;

      Show
      The solution is rather simple, at subclass Reciever add: run { ... if(jg) { obj=channel.receive(0); if(obj instanceof Message) { byte[] buffer = ((Message)obj).getBuffer(); in=new DataInputStream(new ByteArrayInputStream(buffer)); } else { System.out.println("received non-msg: " + obj.getClass()); continue; } } else { sock.receive(packet); in=new DataInputStream(new ByteArrayInputStream(buf)); } number=in.readInt(); matrix [number] [1] =1; if (num_received != number) { System.err.println(" lost packet "+ number); num_received = number; } ... num_received++;

      See at org.jgroups.tests.SpeedTest:

      If pakets get lost - without using JGroups but pure sockets - the SpeedTest never ends.

              rhn-engineering-bban Bela Ban
              dlade_jira Danny Lade (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 5 minutes
                  5m
                  Remaining:
                  Remaining Estimate - 5 minutes
                  5m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified