Package net.i2p.client.impl
Class I2CPMessageProducer
java.lang.Object
net.i2p.client.impl.I2CPMessageProducer
class I2CPMessageProducer extends Object
Produce the various messages the session needs to send to the router.
- Author:
- jrandom
-
Constructor Summary
Constructors Constructor Description I2CPMessageProducer(I2PAppContext context)
-
Method Summary
Modifier and Type Method Description void
connect(I2PSessionImpl session)
Send all the messages that a client needs to send to a router to establish a new session.void
createLeaseSet(I2PSessionImpl session, LeaseSet leaseSet, SigningPrivateKey signingPriv, List<PrivateKey> privs)
In response to a RequestLeaseSet Message from the router, send a CreateLeaseset Message back to the router.void
disconnect(I2PSessionImpl session)
Send messages to the router destroying the session and disconnectingvoid
reportAbuse(I2PSessionImpl session, int msgId, int severity)
Send an abuse message to the routervoid
sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, long expires, int flags)
Package up and send the payload to the router for deliveryvoid
sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, SendMessageOptions options)
Package up and send the payload to the router for deliveryvoid
sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, SessionTag tag, SessionKey key, Set<SessionTag> tags, SessionKey newKey, long expires)
Package up and send the payload to the router for deliveryvoid
updateBandwidth(I2PSessionImpl session)
Update the bandwidth settingvoid
updateTunnels(I2PSessionImpl session, int tunnels)
Update number of tunnels
-
Constructor Details
-
Method Details
-
updateBandwidth
Update the bandwidth setting- Since:
- 0.8.4
-
connect
Send all the messages that a client needs to send to a router to establish a new session.- Throws:
I2PSessionException
-
disconnect
Send messages to the router destroying the session and disconnecting- Throws:
I2PSessionException
-
sendMessage
public void sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, SessionTag tag, SessionKey key, Set<SessionTag> tags, SessionKey newKey, long expires) throws I2PSessionExceptionPackage up and send the payload to the router for delivery- Parameters:
nonce
- 0 to 0xffffffff; if 0, the router will not reply with a MessageStatusMessagetag
- unused - no end-to-end cryptotags
- unused - no end-to-end cryptokey
- unused - no end-to-end cryptonewKey
- unused - no end-to-end crypto- Throws:
I2PSessionException
-
sendMessage
public void sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, long expires, int flags) throws I2PSessionExceptionPackage up and send the payload to the router for delivery- Parameters:
nonce
- 0 to 0xffffffff; if 0, the router will not reply with a MessageStatusMessage- Throws:
I2PSessionException
- Since:
- 0.8.4
-
sendMessage
public void sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, SendMessageOptions options) throws I2PSessionExceptionPackage up and send the payload to the router for delivery- Parameters:
nonce
- 0 to 0xffffffff; if 0, the router will not reply with a MessageStatusMessage- Throws:
I2PSessionException
- Since:
- 0.9.2
-
reportAbuse
public void reportAbuse(I2PSessionImpl session, int msgId, int severity) throws I2PSessionExceptionSend an abuse message to the router- Throws:
I2PSessionException
-
createLeaseSet
public void createLeaseSet(I2PSessionImpl session, LeaseSet leaseSet, SigningPrivateKey signingPriv, List<PrivateKey> privs) throws I2PSessionExceptionIn response to a RequestLeaseSet Message from the router, send a CreateLeaseset Message back to the router. This method is misnamed, it does not create the LeaseSet, the caller does that.- Parameters:
signingPriv
- ignored for LS2- Throws:
I2PSessionException
-
updateTunnels
Update number of tunnels- Parameters:
tunnels
- 0 for original configured number- Throws:
I2PSessionException
-