|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.TransportManager
public class TransportManager
Nested Class Summary | |
---|---|
(package private) static class |
TransportManager.Port
|
Field Summary | |
---|---|
static String |
PROP_ENABLE_NTCP
default true |
static String |
PROP_ENABLE_UDP
default true |
static String |
PROP_ENABLE_UPNP
default true |
Constructor Summary | |
---|---|
TransportManager(RouterContext context)
|
Method Summary | |
---|---|
int |
countActivePeers()
How many peers are we currently connected to, that we have sent a message to or received a message from in the last five minutes. |
int |
countActiveSendPeers()
How many peers are we currently connected to, that we have sent a message to in the last minute. |
void |
externalAddressReceived(Transport.AddressSource source,
byte[] ip,
int port)
Initialize from interfaces, and callback from UPnP or SSU. |
void |
externalAddressRemoved(Transport.AddressSource source,
boolean ipv6)
Remove all ipv4 or ipv6 addresses. |
void |
forwardPortStatus(String style,
byte[] ip,
int port,
int externalPort,
boolean success,
String reason)
callback from UPnP |
List<RouterAddress> |
getAddresses()
This forces a rebuild |
TransportBid |
getBid(OutNetMessage msg)
|
List<TransportBid> |
getBids(OutNetMessage msg)
|
Vector<Long> |
getClockSkews()
Return our peer clock skews on all transports. |
(package private) DHSessionKeyBuilder.Factory |
getDHFactory()
Hook for pluggable transport creation. |
byte[] |
getIP(Hash dest)
IP of the peer from the last connection (in or out, any transport). |
List<String> |
getMostRecentErrorMessages()
|
TransportBid |
getNextBid(OutNetMessage msg)
|
CommSystemFacade.Status |
getReachabilityStatus()
Previously returned short, now enum as of 0.9.20 |
Transport |
getTransport(String style)
|
(package private) int |
getTransportCount()
|
boolean |
haveHighOutboundCapacity()
Are all transports well below their outbound connection limit Use for throttling in the router. |
boolean |
haveInboundCapacity(int pct)
Is at least one transport below its inbound connection limit + some margin Use for throttling in the router. |
boolean |
haveOutboundCapacity(int pct)
Is at least one transport below its outbound connection limit + some margin Use for throttling in the router. |
boolean |
isBacklogged(Hash dest)
|
boolean |
isEstablished(Hash dest)
|
static boolean |
isNTCPEnabled(RouterContext ctx)
|
void |
messageReceived(I2NPMessage message,
RouterIdentity fromRouter,
Hash fromRouterHash)
Message received |
void |
recheckReachability()
Deprecated. unused |
(package private) void |
registerAndStart(Transport t)
Pluggable transports. |
void |
renderStatusHTML(Writer out,
String urlBase,
int sortFlags)
Warning - blocking, very slow, queries the active UPnP router, will take many seconds if it has vanished. |
void |
restart()
|
void |
shutdown()
Cannot be restarted. |
void |
startListening()
|
(package private) void |
stopAndUnregister(Transport t)
Pluggable transports. |
void |
stopListening()
Can be restarted. |
void |
transportAddressChanged()
|
boolean |
wasUnreachable(Hash dest)
Was the peer UNreachable (outbound only) on any transport, based on the last time we tried it for each transport? This is NOT reset if the peer contacts us. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_ENABLE_UDP
public static final String PROP_ENABLE_NTCP
public static final String PROP_ENABLE_UPNP
Constructor Detail |
---|
public TransportManager(RouterContext context)
Method Detail |
---|
void registerAndStart(Transport t)
void stopAndUnregister(Transport t)
DHSessionKeyBuilder.Factory getDHFactory()
public static boolean isNTCPEnabled(RouterContext ctx)
public void externalAddressReceived(Transport.AddressSource source, byte[] ip, int port)
public void externalAddressRemoved(Transport.AddressSource source, boolean ipv6)
public void forwardPortStatus(String style, byte[] ip, int port, int externalPort, boolean success, String reason)
public void startListening()
public void restart()
public void stopListening()
public void shutdown()
public Transport getTransport(String style)
int getTransportCount()
public int countActivePeers()
public int countActiveSendPeers()
public boolean haveOutboundCapacity(int pct)
pct
- percent of limit 0-100public boolean haveHighOutboundCapacity()
public boolean haveInboundCapacity(int pct)
pct
- percent of limit 0-100public Vector<Long> getClockSkews()
public CommSystemFacade.Status getReachabilityStatus()
public void recheckReachability()
public boolean isBacklogged(Hash dest)
public boolean isEstablished(Hash dest)
public boolean wasUnreachable(Hash dest)
public byte[] getIP(Hash dest)
public List<RouterAddress> getAddresses()
public TransportBid getBid(OutNetMessage msg)
public List<TransportBid> getBids(OutNetMessage msg)
public TransportBid getNextBid(OutNetMessage msg)
public void messageReceived(I2NPMessage message, RouterIdentity fromRouter, Hash fromRouterHash)
messageReceived
in interface TransportEventListener
message
- non-nullfromRouter
- may be nullfromRouterHash
- may be null, calculated from fromRouter if nullpublic void transportAddressChanged()
transportAddressChanged
in interface TransportEventListener
public List<String> getMostRecentErrorMessages()
public void renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |