Skip to content
This repository was archived by the owner on Feb 7, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions flood/src/main/java/com/dsvl/flood/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,6 @@ public void sendPingMessage() {
public List<File> search(MessageObject msgObject) {
List<File> results = searchInLocalStore(msgObject.getFile_name());
//TODO: get fixed hop count from property file
//if (nodeAddress.equals(msgObject.getSearch_ip()) && getNodeUdpPort() == msgObject.getSearch_udp_Port()) {
// results.forEach(file -> {
// Result result = new Result(file.getFileName(), getNodeAddress() + ":" + getTcpPort() + "/file/" + file.getFileName(), msgObject.getHops());
//
// Node.latestSearchResults.add(result);
// });
//}

msgObject.setHops(msgObject.getHops() - 1);

if (msgObject.getHops() > 0) {
Expand Down
6 changes: 3 additions & 3 deletions flood/src/main/java/com/dsvl/flood/UdpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ private void respond(MessageObject msgObject, InetAddress senderIP, int senderPo
count+=1;
}
}
if(count==node.getNeighbours().size()){
if(count==node.getNeighbours().size() && !i.getIpAddress().getHostName().equals(node.getNodeAddress())){
newNeighbours.add(i);
// todo potential neighbours list
// potential neighbours list
}

}
// newNeighbours; TODO subhashini this is the unique neighbours list you can call your function here and input this list as a paremeter
node.join(newNeighbours); // send requests to new neighbours

}).start();
break;
Expand Down