public class MultiplexingDiscovery extends Object implements PeerDiscovery
Modifier and Type | Field and Description |
---|---|
protected NetworkParameters |
netParams |
protected List<PeerDiscovery> |
seeds |
Constructor and Description |
---|
MultiplexingDiscovery(NetworkParameters params,
List<PeerDiscovery> seeds)
Will query the given seeds in parallel before producing a merged response.
|
Modifier and Type | Method and Description |
---|---|
protected ExecutorService |
createExecutor() |
static MultiplexingDiscovery |
forServices(NetworkParameters params,
long services)
Builds a suitable set of peer discoveries.
|
InetSocketAddress[] |
getPeers(long services,
long timeoutValue,
TimeUnit timeoutUnit)
Returns an array of addresses.
|
void |
shutdown()
Stops any discovery in progress when we want to shut down quickly.
|
protected final List<PeerDiscovery> seeds
protected final NetworkParameters netParams
public MultiplexingDiscovery(NetworkParameters params, List<PeerDiscovery> seeds)
public static MultiplexingDiscovery forServices(NetworkParameters params, long services)
params
- Network to use.services
- Required services as a bitmask, e.g. VersionMessage.NODE_NETWORK
.public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException
PeerDiscovery
getPeers
in interface PeerDiscovery
services
- Required services as a bitmask, e.g. VersionMessage#NODE_NETWORK
.PeerDiscoveryException
protected ExecutorService createExecutor()
public void shutdown()
PeerDiscovery
shutdown
in interface PeerDiscovery
Copyright © 2016. All rights reserved.