ctx.getChannel().write(frame).addListener(ChannelFutureListener.CLOSE);
} else if (frame instanceof PingWebSocketFrame) {
ctx.getChannel().write(new PongWebSocketFrame(frame.getBinaryData()));
} else if (frame instanceof BinaryWebSocketFrame) {
ChannelBuffer binaryData = frame.getBinaryData();
webSocketProcessor.invokeWebSocketProtocol((WebSocket) ctx.getAttachment(), binaryData.array(), binaryData.arrayOffset(), binaryData.readableBytes());
} else if (frame instanceof TextWebSocketFrame) {
webSocketProcessor.invokeWebSocketProtocol((WebSocket) ctx.getAttachment(), ((TextWebSocketFrame) frame).getText());
} else if (frame instanceof PongWebSocketFrame) {
if (config.enablePong()) {
ctx.getChannel().write(new PingWebSocketFrame(frame.getBinaryData()));