don't send neighbor his own reference
This commit is contained in:
parent
4022a6ee82
commit
140d359aee
@ -102,13 +102,15 @@ public class Node {
|
||||
// loop over each neighbor i
|
||||
for (int i = 0; i < neighbors.size(); i++) {
|
||||
for (int j = 0; j < neighbors.size(); j++) {
|
||||
try {
|
||||
// send all neighbors j to neighbor i
|
||||
putAddrInBuf(buf, neighbors.get(j));
|
||||
channel.send(buf, neighbors.get(i));
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
if(i != j){
|
||||
try {
|
||||
// send all neighbors j to neighbor i
|
||||
putAddrInBuf(buf, neighbors.get(j));
|
||||
channel.send(buf, neighbors.get(i));
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
// send LEAVE to neighbor i
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user