WebSocketPayload<?> wsPayload = (WebSocketPayload<?>) payload;
WebSocketRequestHandler webSocketHandler = wsPayload.getHandler();
if (payload instanceof WebSocketTextPayload)
{
WebSocketTextPayload textPayload = (WebSocketTextPayload) payload;
TextMessage data = textPayload.getMessage();
onMessage(webSocketHandler, data);
}
else if (wsPayload instanceof WebSocketBinaryPayload)
{
WebSocketBinaryPayload binaryPayload = (WebSocketBinaryPayload) wsPayload;