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 Session.Listener
Session.Listener.Abstract, Session.Listener.AbstractAutoDemanding, Session.Listener.AutoDemanding -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonWebSocketBinary(ByteBuffer payload, Callback callback) A WebSocket BINARY message has been received.voidonWebSocketClose(int statusCode, String reason) The WebSocketSessionhas been closed.voidonWebSocketError(Throwable cause) A WebSocket error has occurred during the processing of WebSocket frames.voidonWebSocketOpen(Session session) A WebSocketSessionhas opened successfully and is ready to be used.voidonWebSocketText(String message) A WebSocket TEXT message has been received.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Session.Listener
onWebSocketFrame, onWebSocketPartialBinary, onWebSocketPartialText, onWebSocketPing, onWebSocketPong
-
Constructor Details
-
ListenerEndPoint
public ListenerEndPoint()
-
-
Method Details
-
onWebSocketOpen
Description copied from interface:Session.ListenerA WebSocket
Sessionhas opened successfully and is ready to be used.Applications can store the given
Sessionas a field so it can be used to send messages back to the other peer.- Specified by:
onWebSocketOpenin interfaceSession.Listener- Parameters:
session- the WebSocket session
-
onWebSocketText
Description copied from interface:Session.ListenerA WebSocket TEXT message has been received.
- Specified by:
onWebSocketTextin interfaceSession.Listener- Parameters:
message- the text payload
-
onWebSocketBinary
Description copied from interface:Session.ListenerA WebSocket BINARY message has been received.
- Specified by:
onWebSocketBinaryin interfaceSession.Listener- Parameters:
payload- the raw payload array received
-
onWebSocketError
Description copied from interface:Session.ListenerA 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
Sessionwill be closed, but applications may explicitlyclosetheSessionproviding a different status code or reason.- Specified by:
onWebSocketErrorin interfaceSession.Listener- Parameters:
cause- the error that occurred
-
onWebSocketClose
Description copied from interface:Session.ListenerThe WebSocket
Sessionhas been closed.- Specified by:
onWebSocketClosein interfaceSession.Listener- Parameters:
statusCode- the closestatus codereason- the optional reason for the close
-