public class SSLWebSocketSession extends SSLSession implements IWebSocketSession
| Constructor and Description |
|---|
SSLWebSocketSession(IWebSocketHandler handler,
boolean clientMode)
Constructs a Secure Web Socket session associated with a handler.
|
SSLWebSocketSession(SocketAddress remoteAddress,
IWebSocketHandler handler,
boolean clientMode)
Constructs a Secure Web Socket session associated with a handler and a
remote peer.
|
SSLWebSocketSession(String name,
IWebSocketHandler handler,
boolean clientMode)
Constructs a named Secure Web Socket session associated with a handler.
|
SSLWebSocketSession(String name,
SocketAddress remoteAddress,
IWebSocketHandler handler,
boolean clientMode)
Constructs a named Secure Web Socket session associated with a handler and a
remote peer.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
allocate(int capacity)
Allocates a byte buffer by using the allocator associated with this session.
|
void |
close(int status)
Writes the Web Socket close frame with given status code and then gently
closes this session.
|
void |
close(int status,
String reason)
Writes the Web Socket close frame with given status code and reason and then
gently closes this session.
|
IFuture<Void> |
execute(Runnable task)
Executes a task in the selector-loop's thread this session is registered
with.
|
void |
executenf(Runnable task)
Executes a task in the selector-loop's thread this session is registered
with.
|
IFuture<Void> |
getCloseFuture()
Gets the future that can be use to wait for the completion of the closing
phase.
|
ICodecPipeline |
getCodecPipeline()
Gets the codec pipeline that is associated with this session.
|
ISessionConfig |
getConfig()
Gets the configuration of this session.
|
IFuture<Void> |
getCreateFuture()
Gets the future that can be use to wait for the completion of the
creation phase.
|
long |
getCreationTime()
Gets the session's creation time in milliseconds.
|
IFuture<Void> |
getEndFuture()
Gets the future that can be use to wait for the completion of the ending
phase.
|
IHandshaker |
getHandshaker()
Returns the Web Socket handshaker associated with this session.
|
long |
getLastIoTime()
Gets the time in milliseconds when I/O operation occurred lastly.
|
long |
getLastReadTime()
Gets the time in milliseconds when read operation occurred lastly.
|
long |
getLastWriteTime()
Gets the time in milliseconds when write operation occurred lastly.
|
IFuture<Void> |
getOpenFuture()
Gets the future that can be use to wait for the completion of the opening
phase.
|
long |
getReadBytes()
Gets the total number of bytes which were read from this session.
|
double |
getReadBytesThroughput()
Gets the number of read bytes per second.
|
IFuture<Void> |
getReadyFuture()
Gets the future that can be use to wait for the completion of the Web Socket
handshake phase.
|
ISessionTimer |
getTimer()
Gets the session timer associated with this session.
|
IWebSocketHandler |
getWebSocketHandler()
Returns the Web Socket handler associated with this session
|
long |
getWrittenBytes()
Gets the total number of bytes which were written to this session.
|
double |
getWrittenBytesThroughput()
Gets the number of written bytes per second.
|
boolean |
isDataCopyingOptimized()
Tells if the processing of data is optimized to reduce data copying between
byte buffers.
|
boolean |
isOpen()
Tells if this session is open.
|
boolean |
isReadSuspended()
Tells if read operations are suspended for this session.
|
boolean |
isWriteSuspended()
Tells if write operations are suspended for this session.
|
void |
release(ByteBuffer buffer)
Release given byte buffer by the allocator associated with this session.
|
void |
resumeRead()
Resumes read operations for this session.
|
void |
resumeWrite()
Resumes write operations for this session.
|
void |
suspendRead()
Suspends read operations for this session.
|
void |
suspendWrite()
Suspends write operations for this session.
|
getEngineSessionbeginHandshake, beginLazyHandshake, close, dirtyClose, getExecutor, getHandler, quickClose, setExecutor, write, write, write, write, write, writenf, writenf, writenf, writenf, writenfgetLocalAddress, getParent, getPipeline, getRemoteAddress, getState, write, writenfgetAttributesgetId, getName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHandler, getParent, getPipeline, write, write, write, write, write, write, writenf, writenf, writenf, writenf, writenf, writenfallocate, close, dirtyClose, execute, executenf, getAttributes, getCloseFuture, getCodecPipeline, getConfig, getCreateFuture, getCreationTime, getEndFuture, getId, getLastIoTime, getLastReadTime, getLastWriteTime, getLocalAddress, getName, getOpenFuture, getReadBytes, getReadBytesThroughput, getRemoteAddress, getState, getTimer, getWrittenBytes, getWrittenBytesThroughput, isDataCopyingOptimized, isOpen, isReadSuspended, isWriteSuspended, quickClose, release, resumeRead, resumeWrite, suspendRead, suspendWritepublic SSLWebSocketSession(String name, SocketAddress remoteAddress, IWebSocketHandler handler, boolean clientMode) throws SSLEngineCreateException
name - the name for this session, or null if the
handler's name should be used for this session's nameremoteAddress - the address of the remote peerhandler - the Web Socket handler that should be associated with
this sessionclientMode - true if the session should start its
handshaking (SSL/TLS and Web Socket) in "client" modeSSLEngineCreateException - when the SSL engine could not be createdpublic SSLWebSocketSession(SocketAddress remoteAddress, IWebSocketHandler handler, boolean clientMode) throws SSLEngineCreateException
remoteAddress - the address of the remote peerhandler - the Web Socket handler that should be associated with
this sessionclientMode - true if the session should start its
handshaking (SSL/TLS and Web Socket) in "client" modeSSLEngineCreateException - when the SSL engine could not be createdpublic SSLWebSocketSession(String name, IWebSocketHandler handler, boolean clientMode) throws SSLEngineCreateException
name - the name for this session, or null if the
handler's name should be used for this session's namehandler - the Web Socket handler that should be associated with
this sessionclientMode - true if the session should start its
handshaking (SSL/TLS and Web Socket) in "client" modeSSLEngineCreateException - when the SSL engine could not be createdpublic SSLWebSocketSession(IWebSocketHandler handler, boolean clientMode) throws SSLEngineCreateException
handler - the Web Socket handler that should be associated with
this sessionclientMode - true if the session should start its
handshaking (SSL/TLS and Web Socket) in "client" modeSSLEngineCreateException - when the SSL engine could not be createdpublic IFuture<Void> getReadyFuture()
getReadyFuture in interface ISessionpublic IWebSocketHandler getWebSocketHandler()
IWebSocketSessiongetWebSocketHandler in interface IWebSocketSessionpublic IHandshaker getHandshaker()
IWebSocketSessiongetHandshaker in interface IWebSocketSessionpublic void close(int status)
IWebSocketSessionclose in interface IWebSocketSessionstatus - the status code of the close frame, or -1 if the close frame
should not contain the application body.public void close(int status,
String reason)
IWebSocketSessionclose in interface IWebSocketSessionstatus - the status code of the close frame, or -1 if the close frame
should not contain the application body.reason - the reason of the close frame. If the status argument
equals -1 this argument is ignored.public IFuture<Void> getCreateFuture()
ISessiongetCreateFuture in interface ISessionpublic IFuture<Void> getOpenFuture()
ISessiongetOpenFuture in interface ISessionpublic IFuture<Void> getCloseFuture()
ISessiongetCloseFuture in interface ISessionpublic IFuture<Void> getEndFuture()
ISessiongetEndFuture in interface ISessionpublic ISessionConfig getConfig()
ISessionpublic ICodecPipeline getCodecPipeline()
ISessiongetCodecPipeline in interface ISessionnull if the session does not
support itpublic boolean isOpen()
ISessionIt is equal to:
return getState() == SessionState.OPEN
public void suspendRead()
ISessionsuspendRead in interface ISessionpublic void suspendWrite()
ISessionsuspendWrite in interface ISessionpublic void resumeRead()
ISessionresumeRead in interface ISessionpublic void resumeWrite()
ISessionresumeWrite in interface ISessionpublic boolean isReadSuspended()
ISessionisReadSuspended in interface ISessiontrue if suspendedpublic boolean isWriteSuspended()
ISessionisWriteSuspended in interface ISessiontrue if suspendedpublic final long getReadBytes()
ISessiongetReadBytes in interface ISessionpublic final long getWrittenBytes()
ISessiongetWrittenBytes in interface ISessionpublic final double getReadBytesThroughput()
ISessiongetReadBytesThroughput in interface ISessionpublic final double getWrittenBytesThroughput()
ISessiongetWrittenBytesThroughput in interface ISessionpublic final long getCreationTime()
ISessiongetCreationTime in interface ISessionpublic final long getLastIoTime()
ISessiongetLastIoTime in interface ISessionpublic final long getLastReadTime()
ISessiongetLastReadTime in interface ISessionpublic final long getLastWriteTime()
ISessiongetLastWriteTime in interface ISessionpublic ISessionTimer getTimer()
ISessionpublic boolean isDataCopyingOptimized()
ISession
Checking this flag can be helpful in determining if a buffer allocated by the
ISession.allocate(int) method need to be released after passing it to the
session's write/send methods. For example, if the returned value is
true the buffer will be released automatically and so it should not
be released by a user's implementation.
isDataCopyingOptimized in interface ISessiontrue if the processing of data is optimizedISessionConfig.optimizeDataCopying()public ByteBuffer allocate(int capacity)
ISessionpublic void release(ByteBuffer buffer)
ISessionpublic IFuture<Void> execute(Runnable task)
ISessionpublic void executenf(Runnable task)
ISessionThis method should be used whenever there will be no need to synchronize on a future associated with the specified task. This will save some resources and may improve performance.
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.