Packages that use Connection
Package
Description
Implementation of a TCP-like (reliable, authenticated, in order) set of sockets for communicating over the IP-like (unreliable, unauthenticated, unordered) I2P messages.
Uses of Connection in net.i2p.client.streaming.impl
Fields in net.i2p.client.streaming.impl declared as ConnectionModifier and TypeFieldDescriptionprivate final ConnectionConnectionDataReceiver._connectionStreaming connection.private ConnectionI2PSocketFull._connectionThe connection the socket is full on, if any.private final ConnectionPacketLocal._connectionThe connection the packet was sent on.(package private) final ConnectionPacketDispatcher.Entry.conThe connection the packet belongs to, resolved before queueing.(package private) final ConnectionConnectionManager.PooledConnection.connectionThe pooled connection.Fields in net.i2p.client.streaming.impl with type parameters of type ConnectionModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Long, Connection> ConnectionManager._connectionByInboundIdInbound stream ID (Long) to Connection map.private final ConcurrentHashMap<Long, Connection> ConnectionManager._connectionByOutboundIdOutbound stream ID (Long) to Connection map — reverse index for O(1) lookup.private final Map<Long, Connection> PacketQueue._messageStatusMapConnections awaiting status, by message id.private final LinkedBlockingQueue<Connection> ConnectionHandler._resultQueueThe connections waiting for a worker.Methods in net.i2p.client.streaming.impl that return ConnectionModifier and TypeMethodDescriptionConnectionHandler.accept(long timeoutMs) Receive an incoming connection.private ConnectionEverything about a new inbound connection up to the point where its payload is handed over: the SYN burst gates, the admission reservation, the options and MTU negotiation, and the connection's construction.private ConnectionConnectionManager.acquireFromPool(Destination peer) Try to acquire a pooled connection for the given destination.ConnectionManager.connect(Destination peer, ConnectionOptions opts, I2PSession session) Build a new connection to the given peer.private ConnectionConnectionManager.finalizeConnection(Connection con, Destination peer, ConnectionOptions opts, long connectStart, boolean fromPool) Common post-creation setup for both pooled and new connections.(package private) ConnectionI2PSocketFull.getConnection()Underlying connection.PacketLocal.getConnection()Read the connection this packet is bound to.(package private) ConnectionConnectionManager.getConnectionByInboundId(long id) Look up a connection by its inbound stream ID.(package private) ConnectionConnectionManager.getConnectionByOutboundId(long id) Look up a connection by its outbound stream ID.ConnectionManager.receiveConnection(Packet synPacket) Create a new connection based on the SYN packet we received.Methods in net.i2p.client.streaming.impl that return types with arguments of type ConnectionMethods in net.i2p.client.streaming.impl with parameters of type ConnectionModifier and TypeMethodDescriptionbooleanSchedulerChooser.NullScheduler.accept(Connection con) booleanSchedulerClosed.accept(Connection con) Accept connections where both sides have closed and ACKed, and the final timeout hasn't passed.booleanSchedulerClosing.accept(Connection con) Accept connections where both sides have closed but at least one direction hasn't ACKed the close.booleanSchedulerConnectedBulk.accept(Connection con) Accept connections that are established, using the bulk profile, and not yet closing.booleanSchedulerConnecting.accept(Connection con) Accept connections where the SYN has been sent but not yet ACKed.booleanSchedulerDead.accept(Connection con) Accept connections where the final timeout has passed or a RESET was received.booleanSchedulerHardDisconnected.accept(Connection con) Accept connections that have been locally hard disconnected or sent a RESET, and the final timeout hasn't passed.booleanSchedulerPreconnect.accept(Connection con) Accept locally created connections that haven't sent any packets yet.booleanSchedulerReceived.accept(Connection con) Accept connections that have received a SYN but haven't sent one.booleanTaskScheduler.accept(Connection con) Determine whether this scheduler is fit to operate against the given connection.private booleanConnectionPacketHandler.ack(Connection con, long ackThrough, long[] nacks, Packet packet, boolean isNew, boolean choke) Process the acks in a received packet, and adjust our window and RTT.private booleanConnectionPacketHandler.adjustWindow(Connection con, boolean isNew, long sequenceNum, int numResends, int acked, boolean choke) Adjust the congestion window based on ACKs received.private voidConnectionManager.assignReceiveStreamId(Connection con, Hash destHash) Pick a new random stream ID for the con and assign it, taking care to avoid duplicates, and put it in the connection table.(package private) voidPacketDispatcher.dispatch(long sendStreamId, Connection con, Packet packet) Route (con, packet) to the shard owning the connection and return promptly.private voidPacketHandler.dispatchKnownConnection(Connection con, Packet packet, long sendId) Offload (con, packet) to the shard owning the connection.voidSchedulerChooser.NullScheduler.eventOccurred(Connection con) voidSchedulerClosed.eventOccurred(Connection con) Handles the scheduler event; a no-op as the timeout is handled by the timer.voidSchedulerClosing.eventOccurred(Connection con) Handle an event on a closing connection.voidSchedulerConnectedBulk.eventOccurred(Connection con) Handle an event on a connected bulk connection.voidSchedulerConnecting.eventOccurred(Connection con) Handle an event on a connecting connection.voidSchedulerDead.eventOccurred(Connection con) Handle an event on a dead connection.voidSchedulerHardDisconnected.eventOccurred(Connection con) Handle an event on a hard-disconnected connection.voidSchedulerPreconnect.eventOccurred(Connection con) Handle an event on a preconnect connection.voidSchedulerReceived.eventOccurred(Connection con) Handle an event on a received connection.voidTaskScheduler.eventOccurred(Connection con) An event has occurred (timeout, message sent, or message received), so schedule what to do next based on our current state.private ConnectionConnectionManager.finalizeConnection(Connection con, Destination peer, ConnectionOptions opts, long connectStart, boolean fromPool) Common post-creation setup for both pooled and new connections.SchedulerChooser.getScheduler(Connection con) Return the appropriate scheduler for the given connection.private voidPacketHandler.handleEchoPacket(Connection con, Packet packet) Handles echo packets on known connections.private voidPacketHandler.handleMisroutedPacket(Connection con, Packet packet) Handles a packet that appears on a known connection, but with stream ID mismatches or other anomalies.voidPacket.logTCPDump(Connection con) Generate a pcap/tcpdump-compatible format, so we can use standard debugging tools.voidPacketDispatcher.PacketProcessor.process(Connection con, Packet packet) Process the packet.(package private) voidConnectionManager.publishLifetimeStats(Connection con) Publish a closing connection's lifetime counters.private voidPacketHandler.receiveKnownConnection(Connection con, Packet packet) Process a packet that matches a known connection.(package private) voidConnectionPacketHandler.receivePacket(Packet packet, Connection con) Takes ownership of the packet and calls packet.releasePayload() unless it is passed to the MessageInputStream.booleanConnectionManager.receivePing(Connection con, Packet ping) Process a ping by checking for throttling, etc., then sending a pong.private voidPacketHandler.receivePing(Connection con, Packet packet) Verifies and processes an incoming ping packet.(package private) voidConnectionManager.registerOutboundId(Connection con) Register outbound id.private HashConnectionManager.releaseConnectionReservation(Connection con) Release whatever this connection still holds against a dest budget: first its reservation token, and only if no token was bound, its remote peer (a connection built outside the reservation protocol, so the slot must still be drained or the budget leaks forever).voidConnectionManager.removeConnection(Connection con) Remove a connection from the manager.protected voidSchedulerImpl.reschedule(long msToWait, Connection con) Schedule a connection event to occur after the specified delay.private voidConnectionHandler.resendSynAck(Connection con, Packet syn) Re-send a SYN-ACK in response to a retransmitted SYN for an existing connection.private voidConnectionManager.returnToPool(Connection con) Return a connection to the pool if healthy.(package private) static booleanConnectionPacketHandler.shouldRemainChoked(Connection con, long seqNum, int payloadSize) Determine if a packet should keep the connection choked.voidConnectionManager.updateOptsFromShare(Connection con) Update opts from share.voidTCBShare.updateOptsFromShare(Connection con) Retrieve cached TCB parameters and apply them to the connection's options.voidConnectionManager.updateShareOpts(Connection con) Update share opts.voidTCBShare.updateShareOpts(Connection con) Store the connection's current TCB parameters into the cache.private booleanConnectionPacketHandler.verifyPacket(Packet packet, Connection con) Make sure this packet is ok and that we can continue processing its data.private voidConnectionPacketHandler.verifyReset(Packet packet, Connection con) Make sure this RST packet is valid, and if it is, act on it.private voidConnectionPacketHandler.verifySignature(Packet packet, Connection con) Verify the signature if necessary.voidPcapWriter.write(Packet pkt, Connection con) Write an inbound packet to the pcap file.private voidPcapWriter.wrt(Packet pkt, Connection con, boolean isInbound) Write a packet to the pcap file in the proper format.Constructors in net.i2p.client.streaming.impl with parameters of type ConnectionModifierConstructorDescriptionConnectionDataReceiver(I2PAppContext ctx, Connection con) Create a data receiver for the given connection.(package private)Entry(Connection con, Packet packet) Pairs the two so a retired shard can free the payload on its own.I2PSocketFull(Connection con, I2PAppContext context) Bridge between a connection and the I2PSocket API.PacketLocal(I2PAppContext ctx, Destination to, Connection con) Constructor for a packet bound to a connection.(package private)PooledConnection(Connection con, long now) Puts one connection in the pool.