public interface ByteBlockReceiver extends Receivable
ByteBlockReceiveris used to receive byte blocks (arrays) in a unified way. The
readDatagrams()method provides the next available byte block from the counterpart
DatagramSender; in case there is none available, then this method halts until one is available or the
ByteBlockReceiveris being shut down or the underlying connection is closed. The
Receivable.hasDatagram()method returns true in case a next byte(s) can be fetched via the
readDatagrams()method from the
|Modifier and Type||Method and Description|
byte readDatagrams() throws OpenException, InterruptedException
DatagramSendercounterpart. In case none byte block is available, then this method blocks until one is available. To prevent blocking, use the
Receivable.hasDatagram()method to test beforehand whether a byte is available (in a multi threaded usage scenario,
#hasBlock()is not a reliable indicator whether this method will block or not). When a
Threadis waiting for a byte to be read and
Thread.interrupt()is being called, then the operation is aborted and an
OpenException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
InterruptedException- Thrown when a
Threadis waiting, sleeping, or otherwise occupied, and the
Threadis interrupted, either before or during the activity.
Copyright © 2016. All rights reserved.