public static class TorrentClient.Builder extends Object
| Constructor and Description |
|---|
Builder() |
public TorrentClient.Builder registerModule(IModule module)
public TorrentClient.Builder enableExtensionBit(int bit)
bit - The bit to enable.public TorrentClient.Builder acceptIncomingConnections(boolean acceptIncomingConnections)
acceptIncomingConnections - true when connections should be accepted.public TorrentClient.Builder registerMessage(int id, Supplier<IMessage> messageSupplier)
public TorrentClient.Builder registerTrackerProtocol(String protocol, CheckedBiFunction<String,TorrentClient,ITracker,TrackerException> supplier)
public TorrentClient.Builder setPhaseRegulator(PhaseRegulator phaseRegulator)
public TorrentClient.Builder setConnectionDegradation(ConnectionDegradation connectionDegradation)
public TorrentClient.Builder setPeerConnector(Function<TorrentClient,IPeerConnector> peerConnector)
public TorrentClient.Builder setExecutorService(ScheduledExecutorService executorService)
public TorrentClient.Builder setDownloadPort(int downloadPort)
downloadPort - The port at which we are listeningpublic TorrentClient.Builder setPeerDistributor(Function<TorrentClient,IPeerDistributor> peerDistributor)
IPeerConnector implementation.peerDistributor - The peer distributor.public TorrentClient build() throws Exception
ExceptionCopyright © 2016. All rights reserved.