public static interface ProtocolLayer.Recv extends ProtocolLayer
ProtocolLayer.Recv, ProtocolLayer.SendEMPTY_BUFFER| Modifier and Type | Method and Description |
|---|---|
boolean |
isRecvOpen()
Tracks if this layer is accepting received data via
onRecv(ByteBuffer). |
void |
onRecv(ByteBuffer data)
Callback on data being received from the lower layer.
|
void |
onRecvClosed(IOException cause)
Callback on the lower layer's source of data being closed.
|
init, startvoid onRecv(@NonNull
ByteBuffer data)
throws IOException
data - the data received. Any data consumed from the ByteBuffer can be assumed as processed.
Any data not consumed from the ByteBuffer will be the responsibility of the caller
to resubmit in subsequent calls.IOException - if there was an error during processing of the received data.void onRecvClosed(@CheckForNull
IOException cause)
throws IOException
cause - the cause of the lower layer being closed or null.IOException - if there was an error during the processing of the close notification.boolean isRecvOpen()
onRecv(ByteBuffer).
Once this method returns false it must always return false and can be assumed to behave in
this way.true if accepting received data via onRecv(ByteBuffer).Copyright © 2004–2022. All rights reserved.