public class BasicEngine extends AbstractEngine
AbstractEngine.CloseType
Modifier and Type | Field and Description |
---|---|
protected int |
offset |
handshakeStatus, inboundDone, outboundDone
Constructor and Description |
---|
BasicEngine(int offset) |
Modifier and Type | Method and Description |
---|---|
protected IEngineResult |
closeUnwrap(ByteBuffer dst) |
protected IEngineResult |
closeWrap(ByteBuffer dst) |
protected boolean |
isClosingUnwrap(byte[] data) |
protected IEngineResult |
preUnwrap(ByteBuffer src,
ByteBuffer dst) |
protected IEngineResult |
preWrap(ByteBuffer[] srcs,
ByteBuffer dst) |
IEngineResult |
unwrap(ByteBuffer src,
ByteBuffer dst)
Attempts to encode inbound network data from a data buffer into inbound
application data.
|
IEngineResult |
wrap(ByteBuffer[] srcs,
ByteBuffer dst)
Attempts to encode outbound application data from a subsequence of data buffers
into outbound network data.
|
beginHandshake, cleanup, closeInbound, closeOutbound, getDelegatedTask, getHandshakeStatus, getMaxApplicationBufferSize, getMaxNetworkBufferSize, getMinApplicationBufferSize, getMinNetworkBufferSize, getSession, init, isInboundDone, isOutboundDone, updateHandshakeStatus, wrap
protected IEngineResult closeWrap(ByteBuffer dst)
protected IEngineResult preWrap(ByteBuffer[] srcs, ByteBuffer dst)
public IEngineResult wrap(ByteBuffer[] srcs, ByteBuffer dst) throws Exception
IEngine
Depending on the state of an IEngine
implementation, this method
can produce network data without consuming any application data (for
example, it may generate handshake data.)
If an IEngine
implementation has not yet started its initial
handshake, this method should automatically start the handshake.
srcs
- an array of ByteBuffers
containing the outbound
application datadst
- a ByteBuffer
to hold outbound network dataEngineResult
describing the result of this operation.Exception
- when a problem occurred. Once it is thrown the associated
session will be quickly closedprotected IEngineResult closeUnwrap(ByteBuffer dst)
protected boolean isClosingUnwrap(byte[] data)
protected IEngineResult preUnwrap(ByteBuffer src, ByteBuffer dst)
public IEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws Exception
IEngine
Depending on the state of an IEngine
implementation, this method
can consume network data without producing any application data (for
example, it may generate handshake data.)
If an IEngine
implementation has not yet started its initial
handshake, this method should automatically start the handshake.
src
- a ByteBuffer
containing the inbound
application datadst
- a ByteBuffer
to hold inbound application dataEngineResult
describing the result of this operation.Exception
- when a problem occurred. Once it is thrown the associated
session will be quickly closedCopyright © 2017–2022 SNF4J.ORG. All rights reserved.