mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 07:27:18 +01:00
Change timeout
This commit is contained in:
parent
d562384f73
commit
33682694ed
1 changed files with 16 additions and 0 deletions
|
@ -38,6 +38,8 @@ import javafx.beans.property.ObjectProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
|
|
||||||
import net.tomp2p.connection.Bindings;
|
import net.tomp2p.connection.Bindings;
|
||||||
|
import net.tomp2p.connection.ChannelClientConfiguration;
|
||||||
|
import net.tomp2p.connection.ChannelServerConfiguration;
|
||||||
import net.tomp2p.dht.PeerBuilderDHT;
|
import net.tomp2p.dht.PeerBuilderDHT;
|
||||||
import net.tomp2p.dht.PeerDHT;
|
import net.tomp2p.dht.PeerDHT;
|
||||||
import net.tomp2p.futures.BaseFuture;
|
import net.tomp2p.futures.BaseFuture;
|
||||||
|
@ -59,6 +61,8 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import io.netty.util.concurrent.DefaultEventExecutorGroup;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a DHT peer and bootstraps to the network via a bootstrap node
|
* Creates a DHT peer and bootstraps to the network via a bootstrap node
|
||||||
|
@ -116,12 +120,22 @@ class BootstrappedPeerFactory {
|
||||||
|
|
||||||
public SettableFuture<PeerDHT> start() {
|
public SettableFuture<PeerDHT> start() {
|
||||||
try {
|
try {
|
||||||
|
DefaultEventExecutorGroup eventExecutorGroup = new DefaultEventExecutorGroup(250);
|
||||||
|
ChannelClientConfiguration clientConf = PeerBuilder.createDefaultChannelClientConfiguration();
|
||||||
|
clientConf.pipelineFilter(new PeerBuilder.EventExecutorGroupFilter(eventExecutorGroup));
|
||||||
|
|
||||||
|
ChannelServerConfiguration serverConf = PeerBuilder.createDefaultChannelServerConfiguration();
|
||||||
|
serverConf.pipelineFilter(new PeerBuilder.EventExecutorGroupFilter(eventExecutorGroup));
|
||||||
|
serverConf.connectionTimeoutTCPMillis(5000);
|
||||||
|
|
||||||
Bindings bindings = new Bindings();
|
Bindings bindings = new Bindings();
|
||||||
if (!NETWORK_INTERFACE_UNSPECIFIED.equals(networkInterface))
|
if (!NETWORK_INTERFACE_UNSPECIFIED.equals(networkInterface))
|
||||||
bindings.addInterface(networkInterface);
|
bindings.addInterface(networkInterface);
|
||||||
|
|
||||||
if (useManualPortForwarding) {
|
if (useManualPortForwarding) {
|
||||||
peer = new PeerBuilder(keyPair)
|
peer = new PeerBuilder(keyPair)
|
||||||
|
.channelClientConfiguration(clientConf)
|
||||||
|
.channelServerConfiguration(serverConf)
|
||||||
.ports(port)
|
.ports(port)
|
||||||
.bindings(bindings)
|
.bindings(bindings)
|
||||||
.tcpPortForwarding(port)
|
.tcpPortForwarding(port)
|
||||||
|
@ -130,6 +144,8 @@ class BootstrappedPeerFactory {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
peer = new PeerBuilder(keyPair)
|
peer = new PeerBuilder(keyPair)
|
||||||
|
.channelClientConfiguration(clientConf)
|
||||||
|
.channelServerConfiguration(serverConf)
|
||||||
.ports(port)
|
.ports(port)
|
||||||
.bindings(bindings)
|
.bindings(bindings)
|
||||||
.start();
|
.start();
|
||||||
|
|
Loading…
Add table
Reference in a new issue