@Override public void operationComplete(final ChannelFuture future) throws Exception { if (future.isSuccess()) { ctx.pipeline().remove(SockJsHandler.class); ctx.pipeline().remove(CorsInboundHandler.class); ctx.pipeline().remove(CorsOutboundHandler.class); ctx.pipeline().addLast(new RawWebSocketSendHandler()); service.onOpen(new SockJsSessionContext() { @Override public void send(String message) { ctx.writeAndFlush(new TextWebSocketFrame(message)); } @Override public void close() { ctx.close(); } @Override public ChannelHandlerContext getContext() { return ctx; } }); } } });
@Override public void operationComplete(final ChannelFuture future) throws Exception { if (future.isSuccess()) { ctx.pipeline().remove(SockJsHandler.class); ctx.pipeline().remove(CorsInboundHandler.class); ctx.pipeline().remove(CorsOutboundHandler.class); ctx.pipeline().addLast(new RawWebSocketSendHandler()); service.onOpen(new SockJsSessionContext() { @Override public void send(String message) { ctx.writeAndFlush(new TextWebSocketFrame(message)); } @Override public void close() { ctx.close(); } @Override public ChannelHandlerContext getContext() { return ctx; } }); } } });
public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); }
public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); }