Package net.i2p.router.client
Class ClientMessageEventListener
java.lang.Object
net.i2p.router.client.ClientMessageEventListener
- All Implemented Interfaces:
I2CPMessageReader.I2CPMessageEventListener
class ClientMessageEventListener extends Object implements I2CPMessageReader.I2CPMessageEventListener
Receive events from the client and handle them accordingly (updating the runner when
necessary)
-
Field Summary
Fields Modifier and Type Field Description protected RouterContext
_context
protected ClientConnectionRunner
_runner
-
Constructor Summary
Constructors Constructor Description ClientMessageEventListener(RouterContext context, ClientConnectionRunner runner, boolean enforceAuth)
-
Method Summary
Modifier and Type Method Description void
disconnected(I2CPMessageReader reader)
Notify the listener that the stream this reader was reading was closed.protected void
handleCreateLeaseSet(CreateLeaseSetMessage message)
override for testingprotected void
handleDestLookup(DestLookupMessage message)
override for testingprotected void
handleGetBWLimits(GetBandwidthLimitsMessage message)
Divide router limit by 1.75 for overhead.protected void
handleHostLookup(HostLookupMessage message)
override for testingvoid
messageReceived(I2CPMessageReader reader, I2CPMessage message)
Handle an incoming message and dispatch it to the appropriate handlervoid
readError(I2CPMessageReader reader, Exception error)
Handle notification that there was an errorprotected void
startCreateSessionJob(SessionConfig config)
Override for testing
-
Field Details
-
Constructor Details
-
ClientMessageEventListener
public ClientMessageEventListener(RouterContext context, ClientConnectionRunner runner, boolean enforceAuth)- Parameters:
enforceAuth
- set false for in-JVM, true for socket access
-
-
Method Details
-
messageReceived
Handle an incoming message and dispatch it to the appropriate handler- Specified by:
messageReceived
in interfaceI2CPMessageReader.I2CPMessageEventListener
- Parameters:
reader
- I2CPMessageReader to notifymessage
- the I2CPMessage
-
readError
Handle notification that there was an error- Specified by:
readError
in interfaceI2CPMessageReader.I2CPMessageEventListener
- Parameters:
reader
- I2CPMessageReader to notifyerror
- Exception that was thrown, non-null
-
disconnected
Description copied from interface:I2CPMessageReader.I2CPMessageEventListener
Notify the listener that the stream this reader was reading was closed. For most errors, readError() will be called first, as of 0.9.41- Specified by:
disconnected
in interfaceI2CPMessageReader.I2CPMessageEventListener
- Parameters:
reader
- I2CPMessageReader to notify
-
startCreateSessionJob
Override for testing- Since:
- 0.9.8
-
handleCreateLeaseSet
override for testing -
handleDestLookup
override for testing -
handleHostLookup
override for testing- Since:
- 0.9.11
-
handleGetBWLimits
Divide router limit by 1.75 for overhead. This could someday give a different answer to each client. But it's not enforced anywhere. protected for unit test override
-