Annotation Interface OnWebSocketMessage
Annotation for methods to receive BINARY or TEXT WebSocket events.
Acceptable method patterns:
Text Message Versionspublic void methodName(String text)
public void methodName(Session session, String text)
public void methodName(Reader reader)
public void methodName(Session session, Reader reader)
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.
public void methodName(ByteBuffer message, Callback callback)
public void methodName(Session session, ByteBuffer message, Callback callback)
public void methodName(InputStream stream)
public void methodName(Session session, InputStream stream)
NOTE
Method that takes a InputStream
must have
WebSocket.autoDemand()
set to true
.
These 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.
public void methodName(ByteBuffer payload, boolean last, Callback callback)
public void methodName(Session session, ByteBuffer payload, boolean last, Callback callback)
public void methodName(String payload, boolean last)
public void methodName(Session session, String payload, boolean last)