public interface LogicalConnection extends OutgoingFrames, SuspendToken
Modifier and Type | Method and Description |
---|---|
void |
close()
Send a websocket Close frame, without a status code or reason.
|
void |
close(int statusCode,
String reason)
Send a websocket Close frame, with status code.
|
void |
disconnect()
Terminate the connection (no close frame sent)
|
ByteBufferPool |
getBufferPool()
Get the ByteBufferPool in use by the connection
|
Executor |
getExecutor()
Get the Executor used by this connection.
|
long |
getIdleTimeout()
Get the read/write idle timeout.
|
IOState |
getIOState()
Get the IOState of the connection.
|
InetSocketAddress |
getLocalAddress()
Get the local
InetSocketAddress in use for this connection. |
long |
getMaxIdleTimeout()
Set the maximum number of milliseconds of idleness before the connection is closed/disconnected, (ie no frames are either sent or received)
|
WebSocketPolicy |
getPolicy()
The policy that the connection is running under.
|
InetSocketAddress |
getRemoteAddress()
Get the remote Address in use for this connection.
|
WebSocketSession |
getSession()
Get the Session for this connection
|
boolean |
isOpen()
Test if logical connection is still open
|
boolean |
isReading()
Tests if the connection is actively reading.
|
void |
setMaxIdleTimeout(long ms)
Set the maximum number of milliseconds of idleness before the connection is closed/disconnected, (ie no frames are either sent or received)
|
void |
setNextIncomingFrames(IncomingFrames incoming)
Set where the connection should send the incoming frames to.
|
void |
setSession(WebSocketSession session)
Set the session associated with this connection
|
SuspendToken |
suspend()
Suspend a the incoming read events on the connection.
|
outgoingFrame
resume
void close()
Basic usage: results in an non-blocking async write, then connection close.
StatusCode
,
close(int, String)
void close(int statusCode, String reason)
Advanced usage: results in an non-blocking async write, then connection close.
statusCode
- the status codereason
- the (optional) reason. (can be null for no reason)StatusCode
void disconnect()
ByteBufferPool getBufferPool()
Executor getExecutor()
long getIdleTimeout()
IOState getIOState()
InetSocketAddress getLocalAddress()
InetSocketAddress
in use for this connection.
Note: Non-physical connections, like during the Mux extensions, or during unit testing can result in a InetSocketAddress on port 0 and/or on localhost.
long getMaxIdleTimeout()
WebSocketPolicy getPolicy()
InetSocketAddress getRemoteAddress()
Note: Non-physical connections, like during the Mux extensions, or during unit testing can result in a InetSocketAddress on port 0 and/or on localhost.
WebSocketSession getSession()
boolean isOpen()
boolean isReading()
void setMaxIdleTimeout(long ms)
This idle timeout cannot be garunteed to take immediate effect for any active read/write actions. New read/write actions will have this new idle timeout.
ms
- the number of milliseconds of idle timeoutvoid setNextIncomingFrames(IncomingFrames incoming)
Often this is from the Parser to the start of the extension stack, and eventually on to the session.
incoming
- the incoming frames handlervoid setSession(WebSocketSession session)
session
- the sessionSuspendToken suspend()
Copyright © 1995-2015 Webtide. All Rights Reserved.