Package org.eclipse.jetty.websocket.api
Interface Session
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
WebSocketSession
@Deprecated(since="2021-05-27") public interface Session extends java.io.Closeable
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Session represents an active link of communications with a Remote WebSocket Endpoint.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.Request a close of the current conversation with a normal status code and no reason phrase.void
close(int statusCode, java.lang.String reason)
Deprecated.Send a websocket Close frame, with status code.void
close(CloseStatus closeStatus)
Deprecated.Request Close the current conversation, giving a reason for the closure.void
disconnect()
Deprecated.Issue a harsh disconnect of the underlying connection.long
getIdleTimeout()
Deprecated.Return the number of milliseconds before this conversation will be closed by the container if it is inactive, ie no messages are either sent or received in that time.java.net.InetSocketAddress
getLocalAddress()
Deprecated.Get the address of the local side.WebSocketPolicy
getPolicy()
Deprecated.Access the (now read-only)WebSocketPolicy
in use for this connection.java.lang.String
getProtocolVersion()
Deprecated.Returns the version of the websocket protocol currently being used.RemoteEndpoint
getRemote()
Deprecated.Return a reference to the RemoteEndpoint object representing the other end of this conversation.java.net.InetSocketAddress
getRemoteAddress()
Deprecated.Get the address of the remote side.UpgradeRequest
getUpgradeRequest()
Deprecated.Get the UpgradeRequest used to create this sessionUpgradeResponse
getUpgradeResponse()
Deprecated.Get the UpgradeResponse used to create this sessionboolean
isOpen()
Deprecated.Return true if and only if the underlying socket is open.boolean
isSecure()
Deprecated.Return true if and only if the underlying socket is using a secure transport.void
setIdleTimeout(long ms)
Deprecated.Set the number of milliseconds before this conversation will be closed by the container if it is inactive, ie no messages are either sent or received.SuspendToken
suspend()
Deprecated.Suspend the incoming read events on the connection.
-
-
-
Method Detail
-
close
void close()
Deprecated.Request a close of the current conversation with a normal status code and no reason phrase.This will enqueue a graceful close to the remote endpoint.
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- See Also:
close(CloseStatus)
,close(int, String)
,disconnect()
-
close
void close(CloseStatus closeStatus)
Deprecated.Request Close the current conversation, giving a reason for the closure. Note the websocket spec defines the acceptable uses of status codes and reason phrases.This will enqueue a graceful close to the remote endpoint.
- Parameters:
closeStatus
- the reason for the closure- See Also:
close()
,close(int, String)
,disconnect()
-
close
void close(int statusCode, java.lang.String reason)
Deprecated.Send a websocket Close frame, with status code.This will enqueue a graceful close to the remote endpoint.
- Parameters:
statusCode
- the status codereason
- the (optional) reason. (can be null for no reason)- See Also:
StatusCode
,close()
,close(CloseStatus)
,disconnect()
-
disconnect
void disconnect() throws java.io.IOException
Deprecated.Issue a harsh disconnect of the underlying connection.This will terminate the connection, without sending a websocket close frame.
Once called, any read/write activity on the websocket from this point will be indeterminate.
Once the underlying connection has been determined to be closed, the various onClose() events (either
WebSocketConnectionListener.onWebSocketClose(int, String)
orOnWebSocketClose
) will be called on your websocket.- Throws:
java.io.IOException
- if unable to disconnect- See Also:
close()
,close(CloseStatus)
,close(int, String)
,disconnect()
-
getIdleTimeout
long getIdleTimeout()
Deprecated.Return the number of milliseconds before this conversation will be closed by the container if it is inactive, ie no messages are either sent or received in that time.- Returns:
- the timeout in milliseconds.
-
getLocalAddress
java.net.InetSocketAddress getLocalAddress()
Deprecated.Get the address of the local side.- Returns:
- the local side address
-
getPolicy
WebSocketPolicy getPolicy()
Deprecated.Access the (now read-only)WebSocketPolicy
in use for this connection.- Returns:
- the policy in use
-
getProtocolVersion
java.lang.String getProtocolVersion()
Deprecated.Returns the version of the websocket protocol currently being used. This is taken as the value of the Sec-WebSocket-Version header used in the opening handshake. i.e. "13".- Returns:
- the protocol version
-
getRemote
RemoteEndpoint getRemote()
Deprecated.Return a reference to the RemoteEndpoint object representing the other end of this conversation.- Returns:
- the remote endpoint
-
getRemoteAddress
java.net.InetSocketAddress getRemoteAddress()
Deprecated.Get the address of the remote side.- Returns:
- the remote side address
-
getUpgradeRequest
UpgradeRequest getUpgradeRequest()
Deprecated.Get the UpgradeRequest used to create this session- Returns:
- the UpgradeRequest used to create this session
-
getUpgradeResponse
UpgradeResponse getUpgradeResponse()
Deprecated.Get the UpgradeResponse used to create this session- Returns:
- the UpgradeResponse used to create this session
-
isOpen
boolean isOpen()
Deprecated.Return true if and only if the underlying socket is open.- Returns:
- whether the session is open
-
isSecure
boolean isSecure()
Deprecated.Return true if and only if the underlying socket is using a secure transport.- Returns:
- whether its using a secure transport
-
setIdleTimeout
void setIdleTimeout(long ms)
Deprecated.Set the number of milliseconds before this conversation will be closed by the container if it is inactive, ie no messages are either sent or received.- Parameters:
ms
- the number of milliseconds.
-
suspend
SuspendToken suspend()
Deprecated.Suspend the incoming read events on the connection.- Returns:
- the suspend token suitable for resuming the reading of data on the connection.
-
-