public interface Transport
Modifier and Type | Interface and Description |
---|---|
static class |
Transport.AddressSource |
Modifier and Type | Method and Description |
---|---|
TransportBid |
bid(RouterInfo toAddress,
long dataSize) |
int |
countActivePeers() |
int |
countActiveSendPeers() |
int |
countPeers() |
void |
externalAddressReceived(Transport.AddressSource source,
byte[] ip,
int port)
Notify a transport of an external address change.
|
void |
externalAddressRemoved(Transport.AddressSource source,
boolean ipv6)
Notify a transport of an external address change.
|
void |
forwardPortStatus(byte[] ip,
int port,
int externalPort,
boolean success,
String reason)
Notify a transport of the results of trying to forward a port.
|
Vector<Long> |
getClockSkews() |
List<RouterAddress> |
getCurrentAddresses()
What addresses are we currently listening to?
Replaces getCurrentAddress()
|
List<String> |
getMostRecentErrorMessages() |
CommSystemFacade.Status |
getReachabilityStatus()
Previously returned short, now enum as of 0.9.20
|
int |
getRequestedPort()
What INTERNAL port would the transport like to have forwarded by UPnP.
|
String |
getStyle()
The unique identity of 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 |
isUnreachable(Hash peer) |
void |
mayDisconnect(Hash peer)
Tell the transport that we may disconnect from this peer.
|
void |
recheckReachability()
Deprecated.
unused
|
void |
renderStatusHTML(Writer out,
String urlBase,
int sortFlags) |
void |
send(OutNetMessage msg)
Asynchronously send the message as requested in the message and, if the
send is successful, queue up any msg.getOnSendJob job, and register it
with the OutboundMessageRegistry (if it has a reply selector).
|
void |
setListener(TransportEventListener listener)
Who to notify on message availability
|
void |
startListening() |
void |
stopListening() |
List<RouterAddress> |
updateAddress()
Ask the transport to update its addresses based on current information and return them
|
boolean |
wasUnreachable(Hash peer)
Was the peer UNreachable (outbound only) the last time we tried it?
This is NOT reset if the peer contacts us and it is never expired.
|
TransportBid bid(RouterInfo toAddress, long dataSize)
void send(OutNetMessage msg)
void startListening()
void stopListening()
List<RouterAddress> getCurrentAddresses()
boolean hasCurrentAddress()
List<RouterAddress> updateAddress()
void externalAddressReceived(Transport.AddressSource source, byte[] ip, int port)
source
- defined in Transport.javaip
- typ. IPv4 or IPv6 non-local; may be null to indicate IPv4 failure or port info onlyport
- 0 for unknown or unchangedvoid externalAddressRemoved(Transport.AddressSource source, boolean ipv6)
source
- defined in Transport.javavoid 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.int getRequestedPort()
void setListener(TransportEventListener listener)
String getStyle()
int countPeers()
int countActivePeers()
int countActiveSendPeers()
boolean haveCapacity()
boolean haveCapacity(int pct)
void renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException
IOException
CommSystemFacade.Status getReachabilityStatus()
@Deprecated void recheckReachability()
boolean isBacklogged(Hash peer)
boolean wasUnreachable(Hash peer)
boolean isUnreachable(Hash peer)
boolean isEstablished(Hash peer)
void mayDisconnect(Hash peer)