Package net.i2p.router.client
Class I2CPMessageQueueImpl
java.lang.Object
net.i2p.internal.I2CPMessageQueue
net.i2p.router.client.I2CPMessageQueueImpl
- All Implemented Interfaces:
Closeable,AutoCloseable
Contains the methods to talk to a router or client via I2CP,
when both are in the same JVM.
This interface contains methods to access two queues,
one for transmission and one for receiving.
The methods are identical to those in java.util.concurrent.BlockingQueue
- Since:
- 0.8.3
- Author:
- zzz
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanoffer(I2CPMessage msg) Send a message, nonblockingbooleanoffer(I2CPMessage msg, long timeout) Send a message, blocking.poll()Receive a message, nonblockingvoidput(I2CPMessage msg) Send a message, blocking until space is availabletake()Receive a message, blocking until one is availableMethods inherited from class net.i2p.internal.I2CPMessageQueue
close
-
Constructor Details
-
I2CPMessageQueueImpl
-
-
Method Details
-
offer
Send a message, nonblocking- Specified by:
offerin classI2CPMessageQueue- Returns:
- success (false if no space available)
-
offer
Send a message, blocking.- Specified by:
offerin classI2CPMessageQueue- Parameters:
timeout- how long to wait for space (ms)- Returns:
- success (false if no space available or if timed out)
- Throws:
InterruptedException- Since:
- 0.9.3
-
poll
Receive a message, nonblocking- Specified by:
pollin classI2CPMessageQueue- Returns:
- message or null if none available
-
put
Send a message, blocking until space is available- Specified by:
putin classI2CPMessageQueue- Throws:
InterruptedException
-
take
Receive a message, blocking until one is available- Specified by:
takein classI2CPMessageQueue- Returns:
- message
- Throws:
InterruptedException
-