API, interfaces, and factory for a TCP-like (reliable, authenticated, in order) set of sockets for communicating over IP-like (unreliable, unauthenticated, unordered) I2P messages.
The implementation is split across two jars: the interfaces are in ministreaming.jar, the real work is done in streaming.jar. Clients need both jars, plus i2p.jar, on the classpath to communicate with the router.
To use streams, fetch an I2PSocketManager from I2PSocketManagerFactory, which builds its own I2PSession internally. All communication over that session is handled by the I2PSocketManager, as it imposes its own formatting on raw messages sent and received. To accept streams from other clients on the network, use the blocking I2PServerSocket.accept() method, which provides an I2PSocket when a new one is available. To create a new stream to a peer, use the appropriate I2PSocketManager.connect(Destination, I2PSocketOptions) call.
This package also contains I2PSocketEepGet, an HTTP client that uses an existing I2PSocketManager.
Demo applications are in the demo directory: StreamSinkServer listens on a destination and dumps data from accepted sockets to individual files, while StreamSinkClient connects to a destination, sends a specific amount of random data, then disconnects.
- ClassDescriptionAs this does not (yet) extend ServerSocketChannel it cannot be returned by
StandardServerSocket#getChannel, until we implement an I2P SocketAddress class.Streaming server socket returned byI2PSocketManager.getServerSocket().Streaming socket returned byI2PSocketManager.connect(Destination).A SocketAddress (Destination + port) so we can have SocketChannels.Fetch a URL using a socket from the supplied I2PSocketManager.An I2P-specific IOException thrown from input and output streams, with a stored status code to be used for programmatic responses.Centralize the coordination and multiplexing of the local client's streaming.Listener for notification when an I2P session is disconnected.Simplify the creation of I2PSession and transient I2P Destination objects if necessary to create a socket manager.Define the configuration for streaming and verifying data on the socket.Something that filters incoming streaming connections.An I2PException thrown fromI2PServerSocket.accept()when the router is restarting.A ConnectionFilter that may hold state, can be started and stopped.