public interface Transport| Modifier and Type | Interface and Description |
|---|---|
static class | Transport.AddressSourceSource 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()Number of active peers. |
int | countActiveSendPeers()Number of active send peers. |
int | countPeers()Number of peers. |
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 | forceDisconnect(Hash peer,
String reason)Forcefully disconnect from a peer with a reason for logging. |
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()The list of clock skew measurements from peer communications. |
RouterAddress | getCurrentAddress(boolean ipv6)The first currently listening address of specified IP version. |
List<RouterAddress> | getCurrentAddresses()All addresses this transport is currently listening on. |
List<Hash> | getEstablished()The list of peers this transport has established connections with. |
TransportUtil.IPv6Config | getIPv6Config()The current IPv6 configuration. |
List<String> | getMostRecentErrorMessages()The most recent error messages. |
int[] | getPeerCounts()Detailed peer count statistics by IP version and direction. |
CommSystemFacade.Status | getReachabilityStatus()The current reachability status of this transport. |
int | getRequestedPort()The internal port that the transport wants forwarded via UPnP. |
String | getStyle()The unique style identifier for this transport. |
boolean | hasCurrentAddress()Do we have any current address? |
boolean | haveCapacity()Whether capacity is available for a message. |
boolean | haveCapacity(int pct)Whether capacity is available for the given percentage. |
boolean | isBacklogged(Hash peer)Whether the given peer is backlogged. |
boolean | isConnecting(Hash peer)Check if a connection attempt is in progress for the given peer. |
boolean | isEstablished(Hash peer)Whether the given peer is established. |
boolean | isIPv4Firewalled()Whether force-firewalled for IPv4. |
boolean | isIPv6Firewalled()Whether force-firewalled for IPv6. |
boolean | isUnreachable(Hash peer)Whether the given peer is unreachable. |
void | mayDisconnect(Hash peer)Suggest that transport may disconnect from specified peer. |
void | renderStatusHTML(Writer out,
String urlBase,
int sortFlags)Render the transport status HTML to the given writer. |
void | send(OutNetMessage msg)Asynchronously send a message to the specified peer. |
void | setListener(TransportEventListener listener)The event listener for transport-related notifications. |
void | startListening()Start accepting connections. |
void | stopListening()Stop accepting connections. |
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 sourceip - 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 sourceipv6 - true for IPv6, false for IPv4void forceDisconnect(Hash peer)
peer - hash of the peer to forcefully disconnect fromvoid forceDisconnect(Hash peer, String reason)
peer - hash of the peer to forcefully disconnect fromreason - reason for disconnection (for logging)void 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()
List<String> getMostRecentErrorMessages()
int[] getPeerCounts()
CommSystemFacade.Status getReachabilityStatus()
int getRequestedPort()
String getStyle()
boolean hasCurrentAddress()
boolean haveCapacity()
boolean haveCapacity(int pct)
pct - percent 0-100boolean isBacklogged(Hash peer)
peer - peer hashboolean isConnecting(Hash peer)
peer - hash of the peer to checkboolean isEstablished(Hash peer)
peer - peer hashboolean isIPv4Firewalled()
boolean isIPv6Firewalled()
boolean isUnreachable(Hash peer)
peer - peer hashvoid mayDisconnect(Hash peer)
peer - hash of the peer that may be disconnectedvoid renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException
out - writerurlBase - base URLsortFlags - flagsIOExceptionvoid 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