Package net.i2p.data.i2cp
Class I2CPMessageReader
java.lang.Object
net.i2p.data.i2cp.I2CPMessageReader
- Direct Known Subclasses:
QueuedI2CPMessageReader
public class I2CPMessageReader extends Object
The I2CPMessageReader reads an InputStream (using
I2CPMessageHandler
) and passes out events to a registered
listener, where events are either messages being received, exceptions being
thrown, or the connection being closed. Applications should use this rather
than read from the stream themselves.- Author:
- jrandom
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
I2CPMessageReader.I2CPMessageEventListener
Defines the different events the reader produces while reading the streamprotected class
I2CPMessageReader.I2CPMessageReaderRunner
-
Field Summary
Fields Modifier and Type Field Description protected static AtomicLong
__readerId
protected I2CPMessageReader.I2CPMessageEventListener
_listener
protected I2CPMessageReader.I2CPMessageReaderRunner
_reader
protected Thread
_readerThread
-
Constructor Summary
Constructors Modifier Constructor Description I2CPMessageReader(InputStream stream, I2CPMessageReader.I2CPMessageEventListener lsnr)
protected
I2CPMessageReader(I2CPMessageReader.I2CPMessageEventListener lsnr)
For internal extension only. -
Method Summary
Modifier and Type Method Description I2CPMessageReader.I2CPMessageEventListener
getListener()
void
pauseReading()
Deprecated.unusedvoid
resumeReading()
Deprecated.unusedvoid
setListener(I2CPMessageReader.I2CPMessageEventListener lsnr)
void
startReading()
Instruct the reader to begin reading messages off the streamvoid
stopReading()
Cancel reading.
-
Field Details
-
Constructor Details
-
I2CPMessageReader
-
I2CPMessageReader
For internal extension only. No stream.- Since:
- 0.8.3
-
-
Method Details
-
setListener
-
getListener
-
startReading
public void startReading()Instruct the reader to begin reading messages off the stream -
pauseReading
Deprecated.unusedHave the already started reader pause its reading indefinitely -
resumeReading
Deprecated.unusedResume reading after a pause -
stopReading
public void stopReading()Cancel reading.
-