@FunctionalInterface public interface ShortDatagramProvider
ShortDatagramProvider
is used to receive shorts in a unified way.
The readDatagram()
method provides the next available short from the
counterpart DatagramSender
; in case there is none available, then
this method halts until one is available.Modifier and Type | Method and Description |
---|---|
short |
readDatagram()
Reads (receives) the next short passed from a
DatagramSender
counterpart. |
short readDatagram() throws org.refcodes.component.OpenException, InterruptedException
DatagramSender
counterpart. In case none short is available, then this method blocks
until one is available.
To prevent blocking, use the ShortDatagramReceiver
extension's
Receivable.hasDatagram()
method to test beforehand
whether a byte is available (in a multi-threaded usage scenario,
Receivable.hasDatagram()
is not a reliable indicator
whether this method will block or not).
When a Thread
is waiting for a short to be read and
Thread.interrupt()
is being called, then the operation is aborted
and an InterruptedException
is thrown.ShortDatagramSender
counterpart.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.InterruptedException
- Thrown when a Thread
is waiting,
sleeping, or otherwise occupied, and the Thread
is
interrupted, either before or during the activity.Copyright © 2018. All rights reserved.