public class SocketEndpoint
extends javax.websocket.Endpoint
This web socket server endpoint handles web socket requests coming from <o:socket>
.
Socket
Modifier and Type | Field and Description |
---|---|
static String |
URI_TEMPLATE
The context-relative URI template where the web socket endpoint should listen on.
|
Constructor and Description |
---|
SocketEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
onClose(javax.websocket.Session session,
javax.websocket.CloseReason reason)
Remove given web socket session from the
SocketSessionManager . |
void |
onError(javax.websocket.Session session,
Throwable throwable)
Delegate exception to onClose.
|
void |
onOpen(javax.websocket.Session session,
javax.websocket.EndpointConfig config)
Add given web socket session to the
SocketSessionManager . |
public static final String URI_TEMPLATE
public void onOpen(javax.websocket.Session session, javax.websocket.EndpointConfig config)
SocketSessionManager
. If web socket session is not accepted (i.e. the
channel identifier is unknown), then immediately close with reason VIOLATED_POLICY (close code 1008).onOpen
in class javax.websocket.Endpoint
session
- The opened web socket session.config
- The endpoint configuration.public void onError(javax.websocket.Session session, Throwable throwable)
onError
in class javax.websocket.Endpoint
session
- The errored web socket session.throwable
- The cause.public void onClose(javax.websocket.Session session, javax.websocket.CloseReason reason)
SocketSessionManager
. If there is any exception from onError which was
not caused by GOING_AWAY, then log it. Tomcat <= 8.0.30 is known to throw an unnecessary exception when client
abruptly disconnects, see also issue 57489.onClose
in class javax.websocket.Endpoint
session
- The closed web socket session.reason
- The close reason.Copyright © 2012–2017 OmniFaces. All rights reserved.