if (message instanceof DecodingHybiFrame) {
DecodingHybiFrame frame = (DecodingHybiFrame) message;
frame.dispatchMessage(handler, webSocketConnection, executor, exceptionHandler);
} else {
// Hixie 75/76
final WebSocketFrame frame = (WebSocketFrame) message;
executor.execute(new Runnable() {
@Override
public void run() {
try {
handler.onMessage(webSocketConnection, frame.getTextData());
} catch (Throwable throwable) {
exceptionHandler.uncaughtException(Thread.currentThread(), throwable);
}
}
});