@Override
public void channelRead(ChannelHandlerContext ctx, Object msg)
throws UnknownWebSocketFrameTypeException, ServerConnectorException {
if (!(msg instanceof WebSocketFrame)) {
logger.error("Expecting WebSocketFrame. Unknown type.");
throw new UnknownWebSocketFrameTypeException("Expecting WebSocketFrame. Unknown type.");
}
if (msg instanceof TextWebSocketFrame) {
notifyTextMessage((TextWebSocketFrame) msg);
} else if (msg instanceof BinaryWebSocketFrame) {
notifyBinaryMessage((BinaryWebSocketFrame) msg);
} else if (msg instanceof CloseWebSocketFrame) {
notifyCloseMessage((CloseWebSocketFrame) msg);
} else if (msg instanceof PingWebSocketFrame) {
notifyPingMessage((PingWebSocketFrame) msg);
} else if (msg instanceof PongWebSocketFrame) {
notifyPongMessage((PongWebSocketFrame) msg);
}
}
WebSocketSourceHandler.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:carbon-transports
作者:
评论列表
文章目录