public class PeerNAT extends Object
| Constructor and Description |
|---|
PeerNAT(Peer peer,
NATUtils natUtils,
RelayRPC relayRPC,
boolean manualPorts) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isManualPorts() |
NATUtils |
natUtils() |
Peer |
peer() |
RelayRPC |
relayRPC() |
Ports |
setupPortforwarding(String internalHost,
Ports ports)
The Dynamic and/or Private Ports are those from 49152 through 65535
(http://www.iana.org/assignments/port-numbers).
|
FutureRelayNAT |
startRelay(RelayClientConfig relayConfig,
BootstrapBuilder bootstrapBuilder) |
FutureRelayNAT |
startRelay(RelayClientConfig relayConfig,
FutureDiscover futureDiscover) |
FutureRelayNAT |
startRelay(RelayClientConfig relayConfig,
FutureDiscover futureDiscover,
FutureNAT futureNAT) |
FutureRelayNAT |
startRelay(RelayClientConfig relayConfig,
PeerAddress peerAddress) |
FutureNAT |
startSetupPortforwarding(FutureDiscover futureDiscover) |
FutureNAT |
startSetupPortforwarding(FutureDiscover futureDiscover,
DiscoverBuilder builder)
Setup UPNP or NATPMP port forwarding.
|
FutureDone<PeerConnection> |
startSetupRcon(PeerAddress relayPeerAddress,
PeerAddress unreachablePeerAddress)
This Method creates a
PeerConnection to an unreachable (behind a NAT) peer using an active
relay of the unreachable peer. |
public Peer peer()
public NATUtils natUtils()
public RelayRPC relayRPC()
public boolean isManualPorts()
public FutureNAT startSetupPortforwarding(FutureDiscover futureDiscover)
public FutureNAT startSetupPortforwarding(FutureDiscover futureDiscover, DiscoverBuilder builder)
futureDiscover - The result of the discovery process. This information from the
discovery process is important to setup UPNP or NATPMP. If
this fails, then this future will also fail, and other means
to connect to the network needs to be found.public Ports setupPortforwarding(String internalHost, Ports ports)
internalHost - The IP of the internal hostpublic FutureRelayNAT startRelay(RelayClientConfig relayConfig, PeerAddress peerAddress)
public FutureRelayNAT startRelay(RelayClientConfig relayConfig, BootstrapBuilder bootstrapBuilder)
public FutureRelayNAT startRelay(RelayClientConfig relayConfig, FutureDiscover futureDiscover)
public FutureRelayNAT startRelay(RelayClientConfig relayConfig, FutureDiscover futureDiscover, FutureNAT futureNAT)
public FutureDone<PeerConnection> startSetupRcon(PeerAddress relayPeerAddress, PeerAddress unreachablePeerAddress)
PeerConnection to an unreachable (behind a NAT) peer using an active
relay of the unreachable peer. The connection will be kept open until close() is called.relayPeerAddress - unreachablePeerAddress - timeoutSeconds - FutureDoneTimeoutExceptionCopyright © 2015. All rights reserved.