don't send neighbor his own reference

This commit is contained in:
M.Scholz 2012-11-21 16:26:06 +01:00
parent 4022a6ee82
commit 140d359aee

View File

@ -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