Class WebSocketDocs.ListenerEndPoint
java.lang.Object
org.eclipse.jetty.docs.programming.WebSocketDocs.ListenerEndPoint
- All Implemented Interfaces:
Session.Listener
- Enclosing class:
WebSocketDocs
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.api.Session.Listener
Session.Listener.Abstract, Session.Listener.AbstractAutoDemanding, Session.Listener.AutoDemanding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onWebSocketBinary
(ByteBuffer payload, Callback callback) A WebSocket BINARY message has been received.void
onWebSocketClose
(int statusCode, String reason) The WebSocketSession
has been closed.void
onWebSocketError
(Throwable cause) A WebSocket error has occurred during the processing of WebSocket frames.void
onWebSocketOpen
(Session session) A WebSocketSession
has opened successfully and is ready to be used.void
onWebSocketText
(String message) A WebSocket TEXT message has been received.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.websocket.api.Session.Listener
onWebSocketFrame, onWebSocketPartialBinary, onWebSocketPartialText, onWebSocketPing, onWebSocketPong
-
Constructor Details
-
ListenerEndPoint
public ListenerEndPoint()
-
-
Method Details
-
onWebSocketOpen
Description copied from interface:Session.Listener
A WebSocket
Session
has opened successfully and is ready to be used.Applications can store the given
Session
as a field so it can be used to send messages back to the other peer.- Specified by:
onWebSocketOpen
in interfaceSession.Listener
- Parameters:
session
- the WebSocket session
-
onWebSocketText
Description copied from interface:Session.Listener
A WebSocket TEXT message has been received.
- Specified by:
onWebSocketText
in interfaceSession.Listener
- Parameters:
message
- the text payload
-
onWebSocketBinary
Description copied from interface:Session.Listener
A WebSocket BINARY message has been received.
- Specified by:
onWebSocketBinary
in interfaceSession.Listener
- Parameters:
payload
- the raw payload array received
-
onWebSocketError
Description copied from interface:Session.Listener
A WebSocket error has occurred during the processing of WebSocket frames.
Usually errors occurs from bad or malformed incoming packets, for example text frames that do not contain UTF-8 bytes, frames that are too big, or other violations of the WebSocket specification.
The WebSocket
Session
will be closed, but applications may explicitlyclose
theSession
providing a different status code or reason.- Specified by:
onWebSocketError
in interfaceSession.Listener
- Parameters:
cause
- the error that occurred
-
onWebSocketClose
Description copied from interface:Session.Listener
The WebSocket
Session
has been closed.- Specified by:
onWebSocketClose
in interfaceSession.Listener
- Parameters:
statusCode
- the closestatus code
reason
- the optional reason for the close
-