Implementation of a TCP-like (reliable, authenticated, in order) set of sockets for communicating over the IP-like (unreliable, unauthenticated, unordered) I2P messages. This is the streaming implementation (moved for ticket #1135 to here). For the API (which you probably want), see ministreaming. Clients should not need to access anything in this package directly. Use the interfaces and factory in net.i2p.streaming. Note that this class is split across two jars, streaming.jar and ministreaming.jar. The interfaces and some code are in ministreaming.jar, but the real work gets done in streaming.jar. Clients must have both jars in their classpath. Most clients will require (only) streaming.jar, ministreaming.jar, and i2p.jar in their classpath to communicate with the router.
Interface Summary Interface Description ConnectionManager.PingNotifierThe callback interface for a pong. MessageOutputStream.DataReceiverDefine a component to receive data flushed from this stream MessageOutputStream.WriteStatusDefine a way to detect the status of a write TaskSchedulerCoordinates what we do 'next'.
Class Summary Class Description ConnectionMaintain the state controlling a streaming connection between two destinations. ConnectionDataReceiverReceive data from the MessageOutputStream, build a packet, and send it through a connection. ConnectionHandlerReceive new connection attempts Use a bounded queue to limit the damage from SYN floods, router overload, or a slow client ConnectionManagerCoordinate all of the connections for a single local destination. ConnectionOptionsDefine the current options for the con (and allow custom tweaking midstream) TODO many of these are not per-connection options, and should be migrated somewhere so they aren't copied for every connection ConnectionPacketHandlerReceive a packet for a particular connection - placing the data onto the queue, marking packets as acked, updating various fields, etc. ConnThrottlerCount how often we have received an incoming connection This offers basic DOS protection but is not a complete solution. I2PServerSocketFullBridge to allow accepting new connections I2PSocketFullBridge between the full streaming lib and the I2PSocket API I2PSocketManagerFullCentralize the coordination and multiplexing of the local client's streaming. I2PSocketOptionsImplDefine the configuration for streaming and verifying data on the socket. MessageHandlerReceive raw information from the I2PSession and turn it into Packets, if we can. MessageInputStreamStream that can be given messages out of order yet present them in order. MessageOutputStreamA stream that we can shove data into that fires off those bytes on flush or when the buffer is full. PacketThis contains solely the data that goes out on the wire, including the local and remote port which is embedded in the I2CP overhead, not in the packet itself. PacketHandlerreceive a packet and dispatch it correctly to the connection specified, the server socket, or queue a reply RST packet. PacketLocalThis is the class used for outbound packets. PacketQueueQueue out packets to be sent through the session. PcapWriterWrite a standard pcap file with a "TCP" packet that can be analyzed with standard tools such as wireshark. RetransmissionTimerPer-destination timer SchedulerChooserExamine a connection's state and pick the right scheduler for it. SchedulerClosedScheduler used for after both sides have had their close packets ACKed, but the final timeout hasn't passed. SchedulerClosingScheduler used for after both SYNs have been ACKed and both sides have closed the stream, but either we haven't ACKed their close or they haven't ACKed ours. SchedulerConnectedBulkScheduler used for after our SYN has been sent and ACKed but one (or more) sides haven't closed the stream yet. SchedulerConnectingScheduler used once we've sent our SYN but it hasn't been ACKed yet. SchedulerDeadScheduler used for after the final timeout has passed or the connection was reset. SchedulerHardDisconnectedScheduler used after we've locally done a hard disconnect, but the final timeout hasn't passed. SchedulerImplBase scheduler SchedulerPreconnectScheduler used for locally created connections where we have not yet sent the initial SYN packet. SchedulerReceivedScheduler used after receiving an inbound connection but before we have sent our own SYN. StandardServerSocketBridge to I2PServerSocket. StandardSocketBridge to I2PSocket. TCBShareShare important TCP Control Block parameters across Connections to the same remote peer.
Exception Summary Exception Description TooManyStreamsExceptionWe attempted to have more open streams than we are willing to put up with