Packages that use NodeInfo
Package
Description
BitTorrent distributed hash table (DHT) implementation following the Mainline protocol, for trackerless peer discovery.
Uses of NodeInfo in org.klomp.snark.dht
Classes in org.klomp.snark.dht that implement interfaces with type arguments of type NodeInfoModifier and TypeClassDescription(package private) classComparator for finding nodes closest to a target key in the DHT keyspace.Fields in org.klomp.snark.dht declared as NodeInfoModifier and TypeFieldDescriptionprivate final NodeInfoKRPC._myNodeInfo20 byte random id + 32 byte Hash + 2 byte port.private final NodeInfoKRPC.ReplyWaiter.sentToThe node the request was sent to.Fields in org.klomp.snark.dht with type parameters of type NodeInfoModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<NID, NodeInfo> DHTNodes._nodeMapThe known nodes, by node id.private final ConcurrentHashMap<Token, NodeInfo> KRPC._outgoingTokensIndex to outgoing tokens we generated, sent in reply to a get_peers query.Methods in org.klomp.snark.dht that return NodeInfoModifier and TypeMethodDescriptionThe node with the given ID.KRPC.ReplyWaiter.getSentTo()The destination the packet was sent to.(package private) NodeInfoKRPC.heardAbout(NodeInfo nInfo) Called for bootstrap or for all nodes in a receiveNodes reply.private NodeInfoCalled for a request or response.DHTNodes.putIfAbsent(NodeInfo nInfo) Insert a node if absent.Remove a node by its ID.Methods in org.klomp.snark.dht that return types with arguments of type NodeInfoModifier and TypeMethodDescriptionDHTNodes.findClosest(SHA1Hash h, int numWant) Find the closest nodes to a given hash or node ID.KRPC.findClosest(byte[] ih, int max) Local lookup only.KRPC.receiveNodes(NodeInfo nInfo, byte[] ids) Receive concatenated 54-byte NodeInfos and return as a list.KRPC.removeSelf(List<NodeInfo> nodes, NodeInfo self) Remove any entries equal to ourselves from a list of candidate nodes.DHTNodes.values()All known nodes.Methods in org.klomp.snark.dht with parameters of type NodeInfoModifier and TypeMethodDescriptionprivate booleanAnnounce to a single DHT peer.intCompares two nodes based on their XOR distance to the target key.(package private) NodeInfoKRPC.heardAbout(NodeInfo nInfo) Called for bootstrap or for all nodes in a receiveNodes reply.private NodeInfoCalled for a request or response.private booleanKRPC.lookupDest(NodeInfo nInfo) The dest for a NodeInfo lacking it, stored there.DHTNodes.putIfAbsent(NodeInfo nInfo) Insert a node if absent.private voidKRPC.receiveFindNode(MsgID msgID, NodeInfo nInfo, NID tID) Handle and respond to the query.private voidKRPC.receiveGetPeers(MsgID msgID, NodeInfo nInfo, InfoHash ih, boolean noSeeds, boolean scrape) Handle and respond to the query.KRPC.receiveNodes(NodeInfo nInfo, byte[] ids) Receive concatenated 54-byte NodeInfos and return as a list.KRPC.receivePeers(NodeInfo nInfo, List<BEValue> peers) Receive 32-byte hashes as peer list.private voidKRPC.receivePing(MsgID msgID, NodeInfo nInfo) Handle and respond to the query.private voidKRPC.receivePong(NodeInfo nInfo, byte[] nid) If node info was previously created with the dummy NID, replace it with the received NID.KRPC.removeSelf(List<NodeInfo> nodes, NodeInfo self) Remove any entries equal to ourselves from a list of candidate nodes.private KRPC.ReplyWaiterKRPC.sendAnnouncePeer(NodeInfo nInfo, InfoHash ih, Token token, boolean isSeed) Send an announce_peer query to a node, on the response port.private KRPC.ReplyWaiterKRPC.sendFindNode(NodeInfo nInfo, NID tID) Send a find_node query to a node, on the query port.private KRPC.ReplyWaiterKRPC.sendGetPeers(NodeInfo nInfo, InfoHash ih, boolean noSeeds) Send a get_peers query to a node, on the query port.private booleanSend a nodes response (no token).private booleanSend a nodes response (token is null for find_node, non-null for get_peers).private booleanSend a nodes response, optionally with BEP 33 scrape bloom filters.private booleanKRPC.sendPeers(NodeInfo nInfo, MsgID msgID, Token token, List<byte[]> peers, byte[] bFsd, byte[] bFpe) Send a peers response, optionally with BEP 33 scrape bloom filters.private KRPC.ReplyWaiterSend a ping query to a node, on the query port.private booleanSend a pong response, on the response port used by all responses.private KRPC.ReplyWaiterSend a query message.private booleanSend a response message.private voidCalled when a reply times out.Method parameters in org.klomp.snark.dht with type arguments of type NodeInfoModifier and TypeMethodDescriptionprivate static byte[]Pack the given nodes' data into a single byte array for a nodes response.KRPC.removeSelf(List<NodeInfo> nodes, NodeInfo self) Remove any entries equal to ourselves from a list of candidate nodes.Constructors in org.klomp.snark.dht with parameters of type NodeInfoModifierConstructorDescriptionReplyWaiter(MsgID mID, NodeInfo nInfo, Runnable onReply, Runnable onTimeout) Either wait on this object with a timeout, or use non-null Runnables.