public abstract class RelayClientConfig extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
RelayClientConfig(RelayType type,
int peerMapUpdateInterval,
int failedRelayWaitTime,
int maxFail) |
| Modifier and Type | Method and Description |
|---|---|
void |
addManualRelay(PeerAddress manualRelay)
Add a relay to the relays list
|
abstract BaseRelayClient |
createClient(PeerConnection connection,
Peer peer)
Creates a client object
|
int |
failedRelayWaitTime() |
RelayClientConfig |
failedRelayWaitTime(int failedRelayWaitTime)
Defines how many seconds to wait at least until asking a relay that
denied a relay request or a relay that failed to act as a relay again
|
Collection<PeerAddress> |
manualRelays() |
RelayClientConfig |
manualRelays(Collection<PeerAddress> manualRelays)
Set the relay list where the peer should connect to
|
int |
maxFail() |
RelayClientConfig |
maxFail(int maxFail)
Defines how many times a setup with a relay can fail before it's ignored
|
int |
peerMapUpdateInterval()
Get the peer map update interval in seconds
|
RelayClientConfig |
peerMapUpdateInterval(int peerMapUpdateInterval)
Defines the time interval (in seconds) of sending the peer map of the unreachable peer
to its relays.
|
abstract void |
prepareMapUpdateMessage(Message message)
Gives the opportunity to add more data to the map update message.
|
abstract void |
prepareSetupMessage(Message message)
Gives the opportunity to add more data to the setup message which is sent from the unreachable peer to
the relay peer.
|
String |
toString() |
RelayType |
type() |
protected RelayClientConfig(RelayType type, int peerMapUpdateInterval, int failedRelayWaitTime, int maxFail)
public RelayType type()
public int peerMapUpdateInterval()
public RelayClientConfig peerMapUpdateInterval(int peerMapUpdateInterval)
peerMapUpdateInterval - the interval of updating the own peer map at the relaypublic void addManualRelay(PeerAddress manualRelay)
public RelayClientConfig manualRelays(Collection<PeerAddress> manualRelays)
manualRelays - publicly reachable relay nodespublic Collection<PeerAddress> manualRelays()
public RelayClientConfig failedRelayWaitTime(int failedRelayWaitTime)
failedRelayWaitTime - wait time in secondspublic int failedRelayWaitTime()
public RelayClientConfig maxFail(int maxFail)
maxFail - the allowed number of failspublic int maxFail()
public abstract BaseRelayClient createClient(PeerConnection connection, Peer peer)
public abstract void prepareSetupMessage(Message message)
message - the message that is sent to the relay peer.public abstract void prepareMapUpdateMessage(Message message)
message - the message which is regularly sent to the relay peer to update the routing table.Copyright © 2015. All rights reserved.