net.i2p.router.tunnel
Class TunnelParticipant

java.lang.Object
  extended by net.i2p.router.tunnel.TunnelParticipant

 class TunnelParticipant
extends Object

Participate in a tunnel at a location other than the gateway or outbound endpoint. This participant should be provided with the necessary processor if it is an inbound tunnel endpoint, and that will enable the InboundMessageDistributor to receive defragmented and decrypted messages, which it will then selectively forward.


Constructor Summary
TunnelParticipant(RouterContext ctx, HopConfig config, HopProcessor processor)
          not an inbound endpoint
TunnelParticipant(RouterContext ctx, InboundEndpointProcessor inEndProc)
          inbound endpoint
 
Method Summary
 void dispatch(TunnelDataMessage msg, Hash recvFrom)
           
 int getCompleteCount()
          private void incrementThroughput(Hash prev) { if (true) return; long now = System.currentTimeMillis(); long timeSince = now - _lastCoallesced; if (timeSince >= 60*1000) { int amount = 1024 * _periodMessagesTransferred; int normalized = (int)((double)amount * 60d*1000d / (double)timeSince); _periodMessagesTransferred = 0; _lastCoallesced = now; _context.profileManager().tunnelDataPushed1m(prev, normalized); } else { _periodMessagesTransferred++; } }
 int getFailedCount()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TunnelParticipant

public TunnelParticipant(RouterContext ctx,
                         HopConfig config,
                         HopProcessor processor)
not an inbound endpoint


TunnelParticipant

public TunnelParticipant(RouterContext ctx,
                         InboundEndpointProcessor inEndProc)
inbound endpoint

Method Detail

dispatch

public void dispatch(TunnelDataMessage msg,
                     Hash recvFrom)

getCompleteCount

public int getCompleteCount()
private void incrementThroughput(Hash prev) { if (true) return; long now = System.currentTimeMillis(); long timeSince = now - _lastCoallesced; if (timeSince >= 60*1000) { int amount = 1024 * _periodMessagesTransferred; int normalized = (int)((double)amount * 60d*1000d / (double)timeSince); _periodMessagesTransferred = 0; _lastCoallesced = now; _context.profileManager().tunnelDataPushed1m(prev, normalized); } else { _periodMessagesTransferred++; } }


getFailedCount

public int getFailedCount()

toString

public String toString()
Overrides:
toString in class Object