Package net.i2p.router.client
Class QueuedClientConnectionRunner
- java.lang.Object
-
- net.i2p.router.client.ClientConnectionRunner
-
- net.i2p.router.client.QueuedClientConnectionRunner
-
class QueuedClientConnectionRunner extends ClientConnectionRunner
Zero-copy in-JVM. While super() starts both a reader and a writer thread, we only need a reader thread here.- Since:
- 0.8.3
- Author:
- zzz
-
-
Field Summary
-
Fields inherited from class net.i2p.router.client.ClientConnectionRunner
_context, _log, _manager, _reader
-
-
Constructor Summary
Constructors Constructor Description QueuedClientConnectionRunner(RouterContext context, ClientManager manager, I2CPMessageQueue queue)Create a new runner with the given queues
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voiddoSend(I2CPMessage msg)Actually send the I2CPMessage to the client.StringgetClientVersion()The client version.voidsetClientVersion(String version)Does nothing.voidstartRunning()Starts the reader thread.voidstopRunning()Calls super() to stop the reader, and sends a poison message to the client.(package private) voidwriteMessage(I2CPMessage msg)In super(), doSend queues it to the writer thread and the writer thread calls writeMessage() to write to the output stream.-
Methods inherited from class net.i2p.router.client.ClientConnectionRunner
ackSendMessage, createListener, disconnectClient, disconnectClient, disconnected, distributeMessage, failLeaseRequest, getConfig, getConfig, getDestHash, getDestHash, getDestination, getDestinations, getIsDead, getLeaseRequest, getLeaseSet, getNextMessageId, getPayload, getPrimaryConfig, getSessionId, getSessionIds, getSessionKeyManager, isDead, leaseSetCreated, receiveMessage, receiveMessage, registerEncryptedLS, removePayload, removeSession, reportAbuse, requestLeaseSet, sessionEstablished, setPayload, setSessionId, updateMessageDeliveryStatus
-
-
-
-
Constructor Detail
-
QueuedClientConnectionRunner
public QueuedClientConnectionRunner(RouterContext context, ClientManager manager, I2CPMessageQueue queue)
Create a new runner with the given queues
-
-
Method Detail
-
startRunning
public void startRunning()
Starts the reader thread. Does not call super().- Overrides:
startRunningin classClientConnectionRunner
-
stopRunning
public void stopRunning()
Calls super() to stop the reader, and sends a poison message to the client.- Overrides:
stopRunningin classClientConnectionRunner
-
writeMessage
void writeMessage(I2CPMessage msg)
In super(), doSend queues it to the writer thread and the writer thread calls writeMessage() to write to the output stream. Since we have no writer thread this shouldn't happen.- Overrides:
writeMessagein classClientConnectionRunner
-
doSend
void doSend(I2CPMessage msg) throws I2CPMessageException
Actually send the I2CPMessage to the client. Nonblocking.- Overrides:
doSendin classClientConnectionRunner- Throws:
I2CPMessageException- if queue full or on other errors
-
setClientVersion
public void setClientVersion(String version)
Does nothing. Client version is the core version.- Overrides:
setClientVersionin classClientConnectionRunner- Since:
- 0.9.7
-
getClientVersion
public String getClientVersion()
The client version.- Overrides:
getClientVersionin classClientConnectionRunner- Returns:
- CoreVersion.PUBLISHED_VERSION
- Since:
- 0.9.7
-
-