KadPacket response;
if (version==1)
response = PacketFactory.getResponsePacket(targetID, list);
else
response = PacketFactory.getResponse2Packet(targetID, list);
_network_manager.sendKadPacket(response, new IPAddress(sender), sender.getPort());
break;
}
case FIND_VALUE : {
List<KadContact> list = routing_table.getNearestContacts(targetID, SEARCH_CONTACTS);
KadPacket response;
if (version==1)
response = PacketFactory.getResponsePacket(targetID, list);
else
response = PacketFactory.getResponse2Packet(targetID, list);
_network_manager.sendKadPacket(response, new IPAddress(sender), sender.getPort());
break;
}
case STORE : {
List<KadContact> list = routing_table.getNearestContacts(targetID, PUBLISH_KEYWORD_CONTACT_COUNT);
KadPacket response;
if (version==1)
response = PacketFactory.getResponsePacket(targetID, list);
else
response = PacketFactory.getResponse2Packet(targetID, list);
_network_manager.sendKadPacket(response, new IPAddress(sender), sender.getPort());
}
}
}