Package net.i2p.router.dummy
Class VMCommSystem
java.lang.Object
net.i2p.router.CommSystemFacade
net.i2p.router.dummy.VMCommSystem
- All Implemented Interfaces:
Service
public class VMCommSystem extends CommSystemFacade
Hacked up in-VM comm system for talking between contexts. It doesn't even
generate any routerAddresses, but instead tracks the peers through a singleton.
Currently, the comm system doesn't even inject any lag, though it could (later).
It does honor the standard transport stats though, but not the TCP specific ones.
FOR DEBUGGING AND LOCAL TESTING ONLY.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.i2p.router.CommSystemFacade
CommSystemFacade.Status -
Field Summary
Fields inherited from class net.i2p.router.CommSystemFacade
ROUTER_BUNDLE_NAME, STATUS_DIFFERENT, STATUS_DISCONNECTED, STATUS_HOSED, STATUS_IPV4_DISABLED_IPV6_FIREWALLED, STATUS_IPV4_DISABLED_IPV6_OK, STATUS_IPV4_DISABLED_IPV6_UNKNOWN, STATUS_IPV4_FIREWALLED_IPV6_OK, STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN, STATUS_IPV4_OK_IPV6_FIREWALLED, STATUS_IPV4_OK_IPV6_UNKNOWN, STATUS_IPV4_SNAT_IPV6_OK, STATUS_IPV4_SNAT_IPV6_UNKNOWN, STATUS_IPV4_UNKNOWN_IPV6_FIREWALLED, STATUS_IPV4_UNKNOWN_IPV6_OK, STATUS_OK, STATUS_REJECT_UNSOLICITED, STATUS_UNKNOWN -
Constructor Summary
Constructors Constructor Description VMCommSystem(RouterContext context) -
Method Summary
Modifier and Type Method Description intcountActivePeers()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.intcountActiveSendPeers()How many peers are we currently connected to, that we have sent a message to in the last minute.Set<Hash>getEstablished()Get all the peers we are connected to.X25519KeyFactorygetXDHFactory()Factory for making X25519 key pairs.booleanisEstablished(Hash peer)voidprocessMessage(OutNetMessage msg)The router wants us to send the given message to the peer.voidreceive(byte[] message, Hash fromPeer)We send messages between comms as bytes so that we strip any router-local info.voidrenderStatusHTML(Writer out, String urlBase, int sortFlags)voidrestart()Perform a soft restart.voidshutdown()Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.voidstartup()Instruct the service that it should start normal operation.Methods inherited from class net.i2p.router.CommSystemFacade
createAddresses, forceDisconnect, getCountry, getCountryName, getDHFactory, getFramedAveragePeerClockSkew, getIP, getLocalizedStatusString, getMedianPeerClockSkew, getMostRecentErrorMessages, getOurCountry, getReachabilityStatus, getStatus, getTransports, haveHighOutboundCapacity, haveInboundCapacity, haveOutboundCapacity, initGeoIP, isBacklogged, isDummy, isInStrictCountry, isInStrictCountry, isInStrictCountry, mayDisconnect, notifyRemoveAddress, notifyRemoveAddress, notifyReplaceAddress, queueLookup, recheckReachability, registerTransport, renderPeerHTML, renderStatusHTML, unregisterTransport, wasUnreachable
-
Constructor Details
-
Method Details
-
getXDHFactory
Factory for making X25519 key pairs.- Overrides:
getXDHFactoryin classCommSystemFacade- Since:
- 0.9.49 so some tests don't NPE
-
countActivePeers
public int countActivePeers()Description copied from class:CommSystemFacadeHow many peers are we currently connected to, that we have sent a message to or received a message from in the last five minutes.- Specified by:
countActivePeersin classCommSystemFacade
-
countActiveSendPeers
public int countActiveSendPeers()Description copied from class:CommSystemFacadeHow many peers are we currently connected to, that we have sent a message to in the last minute. Unused for anything, to be removed.- Specified by:
countActiveSendPeersin classCommSystemFacade
-
isEstablished
- Specified by:
isEstablishedin classCommSystemFacade
-
getEstablished
Description copied from class:CommSystemFacadeGet all the peers we are connected to. This should be more efficient than repeated calls to isEstablished() if you have to check a lot.- Specified by:
getEstablishedin classCommSystemFacade- Returns:
- the hashes of all the routers we are connected to, non-null
-
processMessage
The router wants us to send the given message to the peer. Do so, or fire off the failing job.- Specified by:
processMessagein classCommSystemFacade
-
receive
We send messages between comms as bytes so that we strip any router-local info. For example, a router tags the # attempts to send through a leaseSet, what type of tunnel a tunnelId is bound to, etc. -
shutdown
public void shutdown()Description copied from interface:ServiceInstruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. It should not depend on other components at this point. This call DOES block. -
startup
public void startup()Description copied from interface:ServiceInstruct the service that it should start normal operation. This call DOES block until the service is ready. -
restart
public void restart()Description copied from interface:ServicePerform a soft restart. -
renderStatusHTML
- Overrides:
renderStatusHTMLin classCommSystemFacade- Throws:
IOException
-