Package org.bitcoinj.net.discovery
Class DnsDiscovery.DnsSeedDiscovery
- java.lang.Object
-
- org.bitcoinj.net.discovery.DnsDiscovery.DnsSeedDiscovery
-
- All Implemented Interfaces:
PeerDiscovery
- Enclosing class:
- DnsDiscovery
public static class DnsDiscovery.DnsSeedDiscovery extends java.lang.Object implements PeerDiscovery
Implements discovery from a single DNS host.
-
-
Constructor Summary
Constructors Constructor Description DnsSeedDiscovery(NetworkParameters params, java.lang.String hostname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.net.InetSocketAddress>
getPeers(long services, java.time.Duration timeout)
Queries for addresses.void
shutdown()
Stops any discovery in progress when we want to shut down quickly.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.bitcoinj.net.discovery.PeerDiscovery
getPeers
-
-
-
-
Constructor Detail
-
DnsSeedDiscovery
public DnsSeedDiscovery(NetworkParameters params, java.lang.String hostname)
-
-
Method Detail
-
getPeers
public java.util.List<java.net.InetSocketAddress> getPeers(long services, java.time.Duration timeout) throws PeerDiscoveryException
Description copied from interface:PeerDiscovery
Queries for addresses. This method may block.- Specified by:
getPeers
in interfacePeerDiscovery
- Parameters:
services
- required services as a bitmask, e.g.VersionMessage.NODE_NETWORK
timeout
- query timeout- Returns:
- found addresses
- Throws:
PeerDiscoveryException
-
shutdown
public void shutdown()
Description copied from interface:PeerDiscovery
Stops any discovery in progress when we want to shut down quickly.- Specified by:
shutdown
in interfacePeerDiscovery
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-