public interface Receiver
Modifier and Type | Interface and Description |
---|---|
static class |
Receiver.Statistics |
Modifier and Type | Method and Description |
---|---|
Exception |
getCaughtException()
Returns caught exception which is set before stop requested.
|
Receiver.Statistics |
getStatistics() |
boolean |
isStopRequested()
Returns true if the stop is requested, otherwise false.
|
int |
receive(ByteBuffer buffer,
long timeoutMilliseconds) |
void |
requestStop()
Requests stop.
|
void |
setCaughtException(Exception e)
Sets caught exception before requesting receiver thread to stop.
|
void |
setReceiveSpinningTimeout(long timeout)
This method can be used to decrease the latency of the data receiving.
|
void requestStop()
boolean isStopRequested()
void setCaughtException(Exception e)
e
- caught exceptionException getCaughtException()
void setReceiveSpinningTimeout(long timeout)
timeout
- loop period in nanoseconds.int receive(ByteBuffer buffer, long timeoutMilliseconds) throws IOException
buffer
- destination buffertimeoutMilliseconds
- timeout to wait for if there is no data to readNotYetConnectedException
- If this channel is not yet connectedClosedChannelException
- If the channel was closed locallyIOException
Receiver.Statistics getStatistics()
Copyright © 2005–2022 Onix Solutions. All rights reserved.