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)
|
IOState |
getIOState()
Get the IOState of the connection.
|
InetSocketAddress |
getLocalAddress()
Get the local
InetSocketAddress in use for this connection. |
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 |
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()
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.
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 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-2012 Mort Bay Consulting. All Rights Reserved.