use of io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler.HandshakeComplete in project netty by netty.
the class StompWebSocketProtocolCodec method userEventTriggered.
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof WebSocketServerProtocolHandler.HandshakeComplete) {
StompVersion stompVersion = StompVersion.findBySubProtocol(((HandshakeComplete) evt).selectedSubprotocol());
ctx.channel().attr(StompVersion.CHANNEL_ATTRIBUTE_KEY).set(stompVersion);
ctx.pipeline().addLast(new WebSocketFrameAggregator(65536)).addLast(new StompSubframeDecoder()).addLast(new StompSubframeAggregator(65536)).addLast(stompChatHandler).remove(StompWebSocketClientPageHandler.INSTANCE);
} else {
super.userEventTriggered(ctx, evt);
}
}
Aggregations