Class I2PSessionMuxedImpl

All Implemented Interfaces:
I2PSession, I2CPMessageReader.I2CPMessageEventListener
Direct Known Subclasses:
SubSession

class I2PSessionMuxedImpl
extends I2PSessionImpl2
I2PSession with protocol and ports Streaming lib has been modified to send I2PSession.PROTO_STREAMING but still receives all. It sends with fromPort and toPort = 0, and receives on all ports. No datagram apps have been modified yet. Therefore the compatibility situation is as follows: Compatibility: old streaming -> new streaming: sends proto anything, rcvs proto anything new streaming -> old streaming: sends PROTO_STREAMING, ignores rcvd proto old datagram -> new datagram: sends proto anything, rcvs proto anything new datagram -> old datagram: sends PROTO_DATAGRAM, ignores rcvd proto In all the above cases, streaming and datagram receive traffic for the other protocol, same as before. old datagram -> new muxed: doesn't work because the old sends proto 0 but the udp side of the mux registers with PROTO_DATAGRAM, so the datagrams go to the streaming side, same as before. old streaming -> new muxed: works Typical Usage: Streaming + datagrams: I2PSocketManager sockMgr = getSocketManager(); I2PSession session = sockMgr.getSession(); session.addMuxedSessionListener(myI2PSessionMuxedListener, I2PSession.PROTO_DATAGRAM, I2PSession.PORT_ANY); * or * session.addSessionListener(myI2PSessionListener, I2PSession.PROTO_DATAGRAM, I2PSession.PORT_ANY); session.sendMessage(dest, payload, I2PSession.PROTO_DATAGRAM, fromPort, toPort); Datagrams only, with multiple ports: I2PClient client = I2PClientFactory.createClient(); ... I2PSession session = client.createSession(...); session.addMuxedSessionListener(myI2PSessionMuxedListener, I2PSession.PROTO_DATAGRAM, I2PSession.PORT_ANY); * or * session.addSessionListener(myI2PSessionListener, I2PSession.PROTO_DATAGRAM, I2PSession.PORT_ANY); session.sendMessage(dest, payload, I2PSession.PROTO_DATAGRAM, fromPort, toPort); Multiple streaming ports: Needs some streaming lib hacking
Since:
0.7.1
Author:
zzz