use of io.netty.handler.codec.http.websocketx.TextWebSocketFrame in project async-http-client by AsyncHttpClient.
the class NettyWebSocket method handleFrame.
public void handleFrame(WebSocketFrame frame) {
if (frame instanceof TextWebSocketFrame) {
onTextFrame((TextWebSocketFrame) frame);
} else if (frame instanceof BinaryWebSocketFrame) {
onBinaryFrame((BinaryWebSocketFrame) frame);
} else if (frame instanceof CloseWebSocketFrame) {
Channels.setDiscard(channel);
CloseWebSocketFrame closeFrame = (CloseWebSocketFrame) frame;
onClose(closeFrame.statusCode(), closeFrame.reasonText());
Channels.silentlyCloseChannel(channel);
} else if (frame instanceof PingWebSocketFrame) {
onPing((PingWebSocketFrame) frame);
} else if (frame instanceof PongWebSocketFrame) {
onPong((PongWebSocketFrame) frame);
}
}
Aggregations