package net.i2p.client.streaming

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.