Annotation Interface OnWebSocketMessage
Annotation for methods to receive BINARY or TEXT WebSocket events.
Acceptable method signatures for text messages:
public void methodName(Session session, *String text)public void methodName(Session session, *Reader reader)
The * before the parameter type means that the parameter is mandatory.
NOTE
Method that takes a Reader must have
WebSocket.autoDemand() set to true.
NOTE
The Reader argument will always use the UTF-8 charset,
(as dictated by RFC 6455). If you need to use a different charset,
you must use BINARY messages.
Acceptable method signatures for binary messages:
public void methodName(Session session, *ByteBuffer message, *Callback callback)public void methodName(Session session, *InputStream stream)
The * before the parameter type means that the parameter is mandatory.
NOTE
Method that takes a InputStream must have
WebSocket.autoDemand() set to true.
Partial messages are used to receive individual frames (and therefore partial
messages) without aggregating the frames into a complete WebSocket message.
A boolean parameter is supplied to indicate whether the frame is
the last segment of data of the message.
Acceptable method signatures for partial messages:
public void methodName(Session session, *String payload, *boolean last)public void methodName(Session session, *ByteBuffer payload, *boolean last, *Callback callback)
The * before the parameter type means that the parameter is mandatory.