public interface ISessionConfig
Modifier and Type | Method and Description |
---|---|
boolean |
alwaysNotifiedBeingInPipeline()
Determines if the session being associated with the session pipeline should
be notified in a situation when the connection is closed and the processing
of the session was not initiated yet.
|
ICodecExecutor |
createCodecExecutor()
Creates a new codec executor that will be responsible for decoding and
encoding data read/received and written/send in the associated session.
|
SSLEngine |
createSSLEngine(boolean clientMode)
Creates a new SSLEngine for the SSL/DTLS session.
|
SSLEngine |
createSSLEngine(SocketAddress remoteAddress,
boolean clientMode)
Creates a new SSLEngine for the SSL/DTLS session with known remote peer.
|
long |
getDatagramServerSessionNoReopenPeriod()
Determines how long the
DatagramServerHandler should block re-opening of a new session for the
remote peer which session has just been closed. |
EndingAction |
getEndingAction()
Gets the action that should be performed by the selector
loop after ending of the associated session.
|
long |
getEngineHandshakeTimeout()
Determines how long the SNF4J framework should wait for completion of the
handshake phase for engine-driven sessions.
|
int |
getMaxInBufferCapacity()
Gets the maximum capacity for the session's input buffer.
|
int |
getMaxSSLApplicationBufferSizeRatio()
Gets the ratio that is used to calculate the maximum size of the SSL
application buffers.
|
int |
getMaxSSLNetworkBufferSizeRatio()
Gets the ratio that is used to calculate the maximum size of the SSL
network buffers.
|
int |
getMaxWriteSpinCount()
Returns the maximum loop count for write operations performed by the selector
loop before returning control to the NIO selector or to other channel ready
for I/O operations.
|
int |
getMinInBufferCapacity()
Gets the minimum capacity for the session's input buffer.
|
int |
getMinOutBufferCapacity()
Gets the minimum capacity for the session's output buffer.
|
long |
getThroughputCalculationInterval()
Gets the interval in milliseconds between each throughput calculation.
|
boolean |
ignorePossiblyIncompleteDatagrams()
Determines if possibly incomplete datagrams should be ignored.
|
boolean |
optimizeDataCopying()
Determines if the processing of data should be optimized to reduce data
copying between byte buffers.
|
boolean |
waitForInboundCloseMessage()
Determines if the SNF4J framework should wait for the peer's corresponding
close message in situation when the closing was initiated by calling the
EngineStreamSession.close() or
EngineStreamSession.quickClose() method. |
int getMinInBufferCapacity()
This value also determines the initial capacity of the input buffer.
Changing it once an associated session is created has no effect for the session.
int getMaxInBufferCapacity()
Changing it once an associated session is created has no effect for the session.
int getMinOutBufferCapacity()
This configuration parameter is only valid for stream-oriented transmissions.
Changing it once an associated session is created has no effect for the session.
long getThroughputCalculationInterval()
boolean ignorePossiblyIncompleteDatagrams()
If the size of received datagram is bigger than the size of session's input buffer the remainder of the datagram is silently discarded by the NIO API. In some protocols (e.g. TFTP) such situations would lead to erroneous processing of the received datagram.
To solve such situations we can ignore each datagram that fully filled up the session's input buffer. Considering that after detecting such datagram the size of the input buffer will be extended up to the max limit there is a big chance that there will be enough room in the buffer when the ignored (i.e. lost) datagram will be retransmitted by the remote end-point.
Changing it once an associated session is created has no effect for the session.
true
if possibly incomplete datagrams should be
ignoredDatagramChannel.read(java.nio.ByteBuffer)
boolean optimizeDataCopying()
Setting this parameter to true
instructs the write and send
methods that the passed data will be no longer used by the caller. In such
situation the write and send methods may, if possible, eliminate not needed
copy operations what can improve the performance.
In addition, setting this parameter to true
when the allocator
associated with the session supports releasing of no longer used buffers will
also cause data copy optimization between session's internal byte buffers. In
such situation user's implementation is responsible for releasing (calling
ISession.release(java.nio.ByteBuffer)
) of no longer used buffers that was passed to session
handlers or codecs.
true
if the data copy optimization should be enabledEndingAction getEndingAction()
SSLEngine createSSLEngine(boolean clientMode) throws SSLEngineCreateException
clientMode
- true
if the engine should start its handshaking
in client modeSSLEngineCreateException
- when the SSL engine could not be createdSSLEngine createSSLEngine(SocketAddress remoteAddress, boolean clientMode) throws SSLEngineCreateException
remoteAddress
- the address of the remote peerclientMode
- true
if the engine should start its handshaking
in client modeSSLEngineCreateException
- when the SSL engine could not be createdint getMaxSSLApplicationBufferSizeRatio()
SSLEngine
.
As the maximum size of the SSL application buffers cannot be less than the maximum SSL application packet size all values less than 100 will be silently ignored and treated as 100.
SSLSession.getApplicationBufferSize()
int getMaxSSLNetworkBufferSizeRatio()
SSLEngine
.
As the maximum size of the SSL network buffers cannot be less than the maximum SSL network packet size all values less than 100 will be silently ignored and treated as 100.
SSLSession.getPacketBufferSize()
boolean waitForInboundCloseMessage()
EngineStreamSession.close()
or
EngineStreamSession.quickClose()
method.
NOTE: Setting this value to true
may delay the closing of
the connection for an indefinite period of time. Usually it is not
required to wait for the close message (e.g. the TLS specification (RFC
2246))
true
to wait for the peer's corresponding close
message.ICodecExecutor createCodecExecutor()
null
if decoding and encoding
is not required.long getEngineHandshakeTimeout()
HandshakeTimeoutException
will be thrown and the session will be quickly
closed.long getDatagramServerSessionNoReopenPeriod()
DatagramServerHandler
should block re-opening of a new session for the
remote peer which session has just been closed. The purpose of it is to
prevent opening of a new session as a result of receiving some delayed or
retransmitted datagrams.int getMaxWriteSpinCount()
It improves write throughput depending on the platform that JVM runs on.
boolean alwaysNotifiedBeingInPipeline()
If the returned value is false
the session that was not processed yet
will not be notified (i.e. session events will not be fired). However, this
does not apply to the session that owns the pipeline as it will always be
notified.
true
to always notify the session being associated with the
pipelineCopyright © 2017–2022 SNF4J.ORG. All rights reserved.