public interface Transport
| Modifier and Type | Interface and Description |
|---|---|
static class |
Transport.AddressSource
Source of transport address configuration.
|
| Modifier and Type | Method and Description |
|---|---|
TransportBid |
bid(RouterInfo toAddress,
int dataSize)
Request to send a message to the specified router.
|
int |
countActivePeers() |
int |
countActiveSendPeers() |
int |
countPeers() |
void |
externalAddressReceived(Transport.AddressSource source,
byte[] ip,
int port)
Notify transport of an external address change event.
|
void |
externalAddressRemoved(Transport.AddressSource source,
boolean ipv6)
Notify a transport of an external address change.
|
void |
forceDisconnect(Hash peer)
Force immediate disconnection from specified peer.
|
void |
forwardPortStatus(byte[] ip,
int port,
int externalPort,
boolean success,
String reason)
Notify a transport of the results of trying to forward a port.
|
List<Long> |
getClockSkews()
Get list of clock skew measurements from peer communications.
|
RouterAddress |
getCurrentAddress(boolean ipv6)
Get the first currently listening address of specified IP version.
|
List<RouterAddress> |
getCurrentAddresses()
Get all addresses this transport is currently listening on.
|
List<Hash> |
getEstablished()
Get list of peers that this transport has established connections with.
|
TransportUtil.IPv6Config |
getIPv6Config() |
List<String> |
getMostRecentErrorMessages() |
int[] |
getPeerCounts()
Get detailed peer count statistics by IP version and direction.
|
CommSystemFacade.Status |
getReachabilityStatus()
Get the current reachability status of this transport.
|
int |
getRequestedPort()
Get the internal port that transport wants forwarded via UPnP.
|
String |
getStyle()
Get the unique style identifier for this transport.
|
boolean |
hasCurrentAddress()
Do we have any current address?
|
boolean |
haveCapacity() |
boolean |
haveCapacity(int pct) |
boolean |
isBacklogged(Hash peer) |
boolean |
isEstablished(Hash peer) |
boolean |
isIPv4Firewalled()
This returns true if the force-firewalled setting is configured, false otherwise.
|
boolean |
isIPv6Firewalled()
This returns true if the force-firewalled setting is configured, false otherwise.
|
boolean |
isUnreachable(Hash peer) |
void |
mayDisconnect(Hash peer)
Suggest that transport may disconnect from specified peer.
|
void |
renderStatusHTML(Writer out,
String urlBase,
int sortFlags) |
void |
send(OutNetMessage msg)
Asynchronously send a message to the specified peer.
|
void |
setListener(TransportEventListener listener)
Set the event listener for transport-related notifications.
|
void |
startListening() |
void |
stopListening() |
List<RouterAddress> |
updateAddress()
Request transport to update its addresses based on current conditions.
|
boolean |
wasUnreachable(Hash peer)
Check if peer was unreachable on last outbound attempt.
|
TransportBid bid(RouterInfo toAddress, int dataSize)
toAddress - the target router's contact informationdataSize - size of message payload, assumes full 16-byte header,
transports should adjust as necessary for their overheadint countActivePeers()
int countActiveSendPeers()
int countPeers()
void externalAddressReceived(Transport.AddressSource source, byte[] ip, int port)
source - the source of this address change (UPnP, interface, config, SSU)ip - the new external IP address (IPv4 or IPv6), may be null to indicate IPv4 failure or port-only changeport - the new external port number, 0 if unknown or unchangedvoid externalAddressRemoved(Transport.AddressSource source, boolean ipv6)
source - the source of the address removalipv6 - true for IPv6, false for IPv4void forceDisconnect(Hash peer)
peer - hash of the peer to forcefully disconnect fromvoid forwardPortStatus(byte[] ip,
int port,
int externalPort,
boolean success,
String reason)
ip - may be nullport - the internal portexternalPort - the external port, which for now should always be the same as
the internal port if the forwarding was successful.List<Long> getClockSkews()
RouterAddress getCurrentAddress(boolean ipv6)
ipv6 - true to return IPv6 address only; false to return IPv4 address onlyList<RouterAddress> getCurrentAddresses()
List<Hash> getEstablished()
TransportUtil.IPv6Config getIPv6Config()
int[] getPeerCounts()
CommSystemFacade.Status getReachabilityStatus()
int getRequestedPort()
String getStyle()
boolean hasCurrentAddress()
boolean haveCapacity()
boolean haveCapacity(int pct)
boolean isBacklogged(Hash peer)
boolean isEstablished(Hash peer)
boolean isIPv4Firewalled()
boolean isIPv6Firewalled()
boolean isUnreachable(Hash peer)
void mayDisconnect(Hash peer)
peer - hash of the peer that may be disconnectedvoid renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException
IOExceptionvoid send(OutNetMessage msg)
msg - the message to send, containing destination, payload, and callbacksvoid setListener(TransportEventListener listener)
listener - the event listener to receive transport notificationsvoid startListening()
void stopListening()
List<RouterAddress> updateAddress()
boolean wasUnreachable(Hash peer)
peer - hash of the peer to check reachability for