Skip to content

Commit

Permalink
ns
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Apr 28, 2009
1 parent 4156343 commit b29d8ce
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/org/jgroups/protocols/SHARED_LOOPBACK.java
Expand Up @@ -2,7 +2,6 @@

import org.jgroups.Address;
import org.jgroups.Event;
import org.jgroups.Message;
import org.jgroups.PhysicalAddress;
import org.jgroups.stack.IpAddress;

Expand All @@ -14,7 +13,7 @@
* Loopback transport shared by all channels within the same VM. Property for testing is that no messages are lost. Allows
* us to test various protocols (with ProtocolTester) at maximum speed.
* @author Bela Ban
* @version $Id: SHARED_LOOPBACK.java,v 1.7 2009/04/09 09:11:15 belaban Exp $
* @version $Id: SHARED_LOOPBACK.java,v 1.8 2009/04/28 16:00:24 belaban Exp $
*/
public class SHARED_LOOPBACK extends TP {
private static int next_port=10000;
Expand Down Expand Up @@ -70,6 +69,22 @@ public void sendUnicast(PhysicalAddress dest, byte[] data, int offset, int lengt
target.receive(local_addr, data, offset, length);
}

protected void sendToSingleMember(Address dest, byte[] buf, int offset, int length) throws Exception {
Map<Address,SHARED_LOOPBACK> dests=routing_table.get(channel_name);
if(dests == null) {
if(log.isWarnEnabled())
log.warn("no destination found for " + channel_name);
return;
}
SHARED_LOOPBACK target=dests.get(dest);
if(target == null) {
if(log.isWarnEnabled())
log.warn("destination address " + dest + " not found");
return;
}
target.receive(local_addr, buf, offset, length);
}

public String getInfo() {
return toString();
}
Expand Down

0 comments on commit b29d8ce

Please sign in to comment.