net.i2p.router.transport
public class CommSystemFacadeImpl extends CommSystemFacade
Modifier and Type | Field and Description |
---|---|
static String |
PROP_I2NP_NTCP_AUTO_IP |
static String |
PROP_I2NP_NTCP_AUTO_PORT |
static String |
PROP_I2NP_NTCP_HOSTNAME |
static String |
PROP_I2NP_NTCP_PORT |
STATUS_DIFFERENT, STATUS_HOSED, STATUS_OK, STATUS_REJECT_UNSOLICITED, STATUS_UNKNOWN
Constructor and Description |
---|
CommSystemFacadeImpl(RouterContext context) |
Modifier and Type | Method and Description |
---|---|
int |
countActivePeers() |
int |
countActiveSendPeers() |
Set<RouterAddress> |
createAddresses()
Create the set of RouterAddress structures based on the router's config
|
static RouterAddress |
createNTCPAddress(RouterContext ctx)
This only creates an address if the hostname AND port are set in router.config,
which should be rare.
|
TransportBid |
getBid(OutNetMessage msg) |
List<TransportBid> |
getBids(OutNetMessage msg) |
String |
getCountry(Hash peer)
Uses the transport IP first because that lookup is fast,
then the SSU IP from the netDb.
|
String |
getCountryName(String c)
full name for a country code, or the code if we don't know the name
|
long |
getFramedAveragePeerClockSkew(int percentToInclude)
Return framed average clock skew of connected peers in seconds, or null if we cannot answer.
|
byte[] |
getIP(Hash dest) |
List |
getMostRecentErrorMessages() |
TransportBid |
getNextBid(OutNetMessage msg) |
short |
getReachabilityStatus()
Determine under what conditions we are remotely reachable.
|
(package private) int |
getTransportCount() |
boolean |
haveHighOutboundCapacity() |
boolean |
haveInboundCapacity(int pct) |
boolean |
haveOutboundCapacity(int pct) |
boolean |
isBacklogged(Hash dest) |
boolean |
isEstablished(Hash dest) |
void |
notifyReplaceAddress(RouterAddress UDPAddr)
UDP changed addresses, tell NTCP and restart
This should really be moved to ntcp/NTCPTransport.java, why is it here?
|
void |
processMessage(OutNetMessage msg)
Send the message out
|
void |
queueLookup(byte[] ip) |
void |
recheckReachability() |
String |
renderPeerHTML(Hash peer)
Provide a consistent "look" for displaying router IDs in the console
|
void |
renderStatusHTML(Writer out,
String urlBase,
int sortFlags) |
void |
restart()
Perform a soft restart.
|
void |
shutdown()
Instruct the service that the router is shutting down and that it should do
whatever is necessary to go down gracefully.
|
void |
startup()
Instruct the service that it should start normal operation.
|
boolean |
wasUnreachable(Hash dest) |
getMedianPeerClockSkew, renderStatusHTML
public static final String PROP_I2NP_NTCP_HOSTNAME
public static final String PROP_I2NP_NTCP_PORT
public static final String PROP_I2NP_NTCP_AUTO_PORT
public static final String PROP_I2NP_NTCP_AUTO_IP
public CommSystemFacadeImpl(RouterContext context)
public void startup()
Service
public void shutdown()
Service
public void restart()
Service
public int countActivePeers()
countActivePeers
in class CommSystemFacade
public int countActiveSendPeers()
countActiveSendPeers
in class CommSystemFacade
public boolean haveInboundCapacity(int pct)
haveInboundCapacity
in class CommSystemFacade
public boolean haveOutboundCapacity(int pct)
haveOutboundCapacity
in class CommSystemFacade
public boolean haveHighOutboundCapacity()
haveHighOutboundCapacity
in class CommSystemFacade
public long getFramedAveragePeerClockSkew(int percentToInclude)
CommSystemFacade
getFramedAveragePeerClockSkew
in class CommSystemFacade
percentToInclude
- 1-100public List<TransportBid> getBids(OutNetMessage msg)
public TransportBid getBid(OutNetMessage msg)
public TransportBid getNextBid(OutNetMessage msg)
int getTransportCount()
public void processMessage(OutNetMessage msg)
processMessage
in class CommSystemFacade
public boolean isBacklogged(Hash dest)
isBacklogged
in class CommSystemFacade
public boolean isEstablished(Hash dest)
isEstablished
in class CommSystemFacade
public boolean wasUnreachable(Hash dest)
wasUnreachable
in class CommSystemFacade
public byte[] getIP(Hash dest)
getIP
in class CommSystemFacade
public List getMostRecentErrorMessages()
getMostRecentErrorMessages
in class CommSystemFacade
public short getReachabilityStatus()
CommSystemFacade
getReachabilityStatus
in class CommSystemFacade
public void recheckReachability()
recheckReachability
in class CommSystemFacade
public void renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException
renderStatusHTML
in class CommSystemFacade
IOException
public Set<RouterAddress> createAddresses()
CommSystemFacade
createAddresses
in class CommSystemFacade
public static RouterAddress createNTCPAddress(RouterContext ctx)
public void notifyReplaceAddress(RouterAddress UDPAddr)
notifyReplaceAddress
in class CommSystemFacade
public void queueLookup(byte[] ip)
queueLookup
in class CommSystemFacade
public String getCountry(Hash peer)
getCountry
in class CommSystemFacade
public String getCountryName(String c)
getCountryName
in class CommSystemFacade
public String renderPeerHTML(Hash peer)
renderPeerHTML
in class CommSystemFacade