Packages that use NTCPConnection
Package
Description
NTCP2, the TCP transport: framed, ratchet-encrypted and mutually authenticated connections between routers.
Helpers and handlers for the router console user interface, packaged in routerconsole.war and accessible only from JSP files.
Uses of NTCPConnection in net.i2p.router.transport.ntcp
Fields in net.i2p.router.transport.ntcp declared as NTCPConnectionModifier and TypeFieldDescriptionprotected final NTCPConnectionEstablishBase._conConnection being established by this handshake.private final NTCPConnectionOutboundNTCP2State._conThe connection being established.Fields in net.i2p.router.transport.ntcp with type parameters of type NTCPConnectionModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Hash, NTCPConnection> NTCPTransport._conByIdentOpen connections, by peer hash.private final Set<NTCPConnection> NTCPTransport._establishingList of NTCPConnection of connections not yet established that we want to remove on establishment or close on timeout.private final Set<NTCPConnection> Reader._liveReadsConnections being read by a runner.private final Set<NTCPConnection> Writer._liveWritesConnections being written by a runner.private final Set<NTCPConnection> Reader._pendingConnectionsConnections waiting for a runner.private final Set<NTCPConnection> Writer._pendingConnectionsConnections waiting for a runner.private final Set<NTCPConnection> Reader._readAfterLiveConnections to read after the live ones.private final Queue<NTCPConnection> EventPumper._wantsConRegisterOutbound connections waiting for selector registration.private final Queue<NTCPConnection> EventPumper._wantsReadThe following 3 are unbounded and lockless for performance inEventPumper.runDelayedEvents().private final Set<NTCPConnection> EventPumper._wantsWriteConnections waiting for the selector to watch writes.private final Set<NTCPConnection> Writer._writeAfterLiveConnections to write after the live ones.Methods in net.i2p.router.transport.ntcp that return NTCPConnectionModifier and TypeMethodDescriptionprivate NTCPConnectionNTCPTransport.getConnectionOrCreateNew(Hash ih, RouterInfo target) Retrieves an existing NTCPConnection for the given peer hash or creates a new one.(package private) NTCPConnectionNTCPTransport.inboundEstablished(NTCPConnection con) Registers a newly established inbound connection, replacing any existing connection for the same peer.private NTCPConnectionNTCPConnection.locked_close(boolean allowRequeue) The connection; usually this, but could be a second connection with the same peer.(package private) NTCPConnectionNTCPTransport.removeCon(NTCPConnection con) The connection removed; usually the con passed in, but possibly a second connection with the same peer.Methods in net.i2p.router.transport.ntcp that return types with arguments of type NTCPConnectionMethods in net.i2p.router.transport.ntcp with parameters of type NTCPConnectionModifier and TypeMethodDescription(package private) static booleanEventPumper.closeIdleOrSendRouterInfo(NTCPConnection con, long now, long expire, long failsafeIterationFreq) Close a connection that has exceeded its idle timeout, or send our RouterInfo when the connection has been established long enough that periodic re-announce is due (uptime in the RI_STORE_INTERVAL band).voidReader.connectionClosed(NTCPConnection con) Removes a closed connection from the queues.voidWriter.connectionClosed(NTCPConnection con) Removes a closed connection from the queues.private voidEventPumper.countInboundNoMessage(String ipStr, NTCPConnection con, String reason) Record an inbound connection that closed before delivering any message, feeding the per-IP attempt counter and the drop statistic.(package private) voidNTCPTransport.establishing(NTCPConnection con) Add us to the establishment timeout process.(package private) static longEventPumper.getIdleExpire(NTCPConnection con, boolean haveCap, long expireIdleWriteTime) Choose the idle timeout for a single connection.private voidEventPumper.handleConnectError(NTCPConnection con, IOException ioe) Handle an outbound connect that failed with an I/O error: log at debug (or a quiet warn) level, close the connection, record the peer for retry backoff, and mark it unreachable so the transport stops attempting it until it hears proof of life.private booleanEventPumper.handleReadData(NTCPConnection con, SelectionKey key, ByteBuffer buf, int totalRead, boolean eof) Hand a filled read buffer to the connection, honoring the bandwidth limiter.private voidEventPumper.handleReadEof(NTCPConnection con, SocketChannel chan, ByteBuffer buf) Handle end-of-stream on a read.private voidEventPumper.handleReadError(NTCPConnection con, IOException ioe, boolean shouldInfo) Handle an I/O error on a read.private voidEventPumper.handleReadZero(NTCPConnection con, boolean shouldDebug, boolean shouldInfo) Handle a select() wakeup with no readable bytes.(package private) NTCPConnectionNTCPTransport.inboundEstablished(NTCPConnection con) Registers a newly established inbound connection, replacing any existing connection for the same peer.private voidNTCPTransport.prepareConnectionForSending(NTCPConnection con, OutNetMessage msg) Prepares the given NTCPConnection for sending the specified message, including checking message types and connection version, sending control info if needed, and ensuring the channel is open.private voidReader.processRead(NTCPConnection con) Process everything read.private booleanEventPumper.processWrite(NTCPConnection con, SelectionKey key) Try to write the queued buffers for the connection.voidEventPumper.registerConnect(NTCPConnection con) Outbound connection registration with optional retry backoff.(package private) NTCPConnectionNTCPTransport.removeCon(NTCPConnection con) The connection removed; usually the con passed in, but possibly a second connection with the same peer.voidEventPumper.wantsRead(NTCPConnection con) This is only called fromNTCPConnection.complete()if there is more data, which is rare (never?) so we don't need to check for dups or make _wantsRead a Set.voidReader.wantsRead(NTCPConnection con) Registers a connection to be read.voidEventPumper.wantsWrite(NTCPConnection con) Called by the connection when it has data ready to write (after bw allocation).voidWriter.wantsWrite(NTCPConnection con, String source) Registers a connection to be written.(package private) static EventPumper.WriteStateEventPumper.writeOneBuffer(NTCPConnection con, SocketChannel chan) Write one queued buffer to the socket.Constructors in net.i2p.router.transport.ntcp with parameters of type NTCPConnectionModifierConstructorDescriptionprotectedEstablishBase(RouterContext ctx, NTCPTransport transport, NTCPConnection con) Binds the context, transport and connection, sizing the padding buffer.InboundEstablishState(RouterContext ctx, NTCPTransport transport, NTCPConnection con) Creates a new InboundEstablishState for the given context, transport, and connection.OutboundNTCP2State(RouterContext ctx, NTCPTransport transport, NTCPConnection con) Create a new outbound NTCP2 state.Uses of NTCPConnection in net.i2p.router.web.helpers
Classes in net.i2p.router.web.helpers that implement interfaces with type arguments of type NTCPConnectionModifier and TypeClassDescriptionprivate static classSorts NTCP connections by a chosen field.Methods in net.i2p.router.web.helpers that return types with arguments of type NTCPConnectionModifier and TypeMethodDescriptionprivate Comparator<NTCPConnection> PeerHelper.getNTCPComparator(int sortFlags) Returns the comparator for the chosen sort.Methods in net.i2p.router.web.helpers with parameters of type NTCPConnectionModifier and TypeMethodDescriptionintPeerHelper.PeerComparator.compare(NTCPConnection l, NTCPConnection r) private static booleanPeerHelper.includeNTCP(NTCPConnection con, int peerCount, long now) Whether an NTCP connection is recent enough to render.private voidPeerHelper.renderNTCPRow(StringBuilder buf, NTCPConnection con, long now, boolean ipv6Enabled, int peerCount, PeerHelper.NTCPTotals totals) Append one NTCP peer row and accumulate its stats into totals.