java.lang.Object
net.i2p.client.impl.I2PSessionImpl.AvailabilityNotifier
net.i2p.client.impl.I2PSessionMuxedImpl.MuxedAvailabilityNotifier
- All Implemented Interfaces:
Runnable
- Enclosing class:
I2PSessionMuxedImpl
protected class I2PSessionMuxedImpl.MuxedAvailabilityNotifierextends I2PSessionImpl.AvailabilityNotifier
MuxedAvailabilityNotifier Extends AvailabilityNotifier.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanTrue while the queue runs.private final LinkedBlockingQueue<I2PSessionMuxedImpl.MsgData> The messages waiting to be delivered.private static final intThe poison size that ends the queue.private final AtomicBooleanTrue once stopping was asked.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidavailable(long msgId, int size) Notify that a message is available.voidavailable(long msgId, int size, int proto, int fromPort, int toPort) Notify that data is available.voidrun()Notify the client thread of available messages, untilstopNotifying()is called.voidStop availability notifications.
Field Details
_msgs
The messages waiting to be delivered._alive
private volatile boolean _aliveTrue while the queue runs.POISON_SIZE
private static final int POISON_SIZEThe poison size that ends the queue.- See Also:
stopping
True once stopping was asked.
Constructor Details
MuxedAvailabilityNotifier
public MuxedAvailabilityNotifier()Create a notifier with an empty pending queue.
Method Details
stopNotifying
public void stopNotifying()Stop availability notifications.- Overrides:
stopNotifyingin classI2PSessionImpl.AvailabilityNotifier
available
public void available(long msgId, int size) Description copied from class:I2PSessionImpl.AvailabilityNotifierNotify that a message is available.- Overrides:
availablein classI2PSessionImpl.AvailabilityNotifier- Parameters:
msgId- the message IDsize- the unencrypted payload length in bytes
available
public void available(long msgId, int size, int proto, int fromPort, int toPort) Notify that data is available.- Parameters:
msgId- the message id the data arrived forsize- the size of the message in bytesproto- the I2CP protocol number the message was received onfromPort- the origin port at the remote router that sent ittoPort- the destination port at this router it was sent to
run
public void run()Notify the client thread of available messages, untilstopNotifying()is called.- Specified by:
runin interfaceRunnable- Overrides:
runin classI2PSessionImpl.AvailabilityNotifier