protected WebSocketFilter createWebSocketFilter() { return new WebSocketFilter(timeout); } }
@Override protected NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException { return handleServerHandshake(ctx, content); }
/** * Handle server-side websocket handshake * * @param ctx {@link FilterChainContext} * @param requestContent HTTP message * @throws {@link IOException} */ private NextAction handleServerHandshake(final FilterChainContext ctx, final HttpContent requestContent) throws IOException { // get HTTP request headers final HttpRequestPacket request = (HttpRequestPacket) requestContent.getHttpHeader(); try { if (doServerUpgrade(ctx, requestContent)) { return ctx.getInvokeAction(); // not a WS request, pass to the next filter. } setIdleTimeout(ctx); } catch (HandshakeException e) { ctx.write(composeHandshakeError(request, e)); throw e; } requestContent.recycle(); return ctx.getStopAction(); }
/** * Handle server-side websocket handshake * * @param ctx {@link FilterChainContext} * @param requestContent HTTP message * @throws {@link IOException} */ private NextAction handleServerHandshake(final FilterChainContext ctx, final HttpContent requestContent) throws IOException { // get HTTP request headers final HttpRequestPacket request = (HttpRequestPacket) requestContent.getHttpHeader(); try { if (doServerUpgrade(ctx, requestContent)) { return ctx.getInvokeAction(); // not a WS request, pass to the next filter. } setIdleTimeout(ctx); } catch (HandshakeException e) { ctx.write(composeHandshakeError(request, e)); throw e; } requestContent.recycle(); return ctx.getStopAction(); }
/** * Handle server-side websocket handshake * * @param ctx {@link FilterChainContext} * @param requestContent HTTP message * @throws {@link IOException} */ private NextAction handleServerHandshake(final FilterChainContext ctx, final HttpContent requestContent) throws IOException { // get HTTP request headers final HttpRequestPacket request = (HttpRequestPacket) requestContent.getHttpHeader(); try { if (doServerUpgrade(ctx, requestContent)) { return ctx.getInvokeAction(); // not a WS request, pass to the next filter. } setIdleTimeout(ctx); } catch (HandshakeException e) { ctx.write(composeHandshakeError(request, e)); throw e; } requestContent.recycle(); return ctx.getStopAction(); }
protected WebSocketFilter createWebSocketFilter() { return new WebSocketFilter(timeout); } }
@Override protected NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException { return handleServerHandshake(ctx, content); }
/** * Handle server-side websocket handshake * * @param ctx {@link FilterChainContext} * @param requestContent HTTP message * @throws {@link IOException} */ private NextAction handleServerHandshake(final FilterChainContext ctx, final HttpContent requestContent) throws IOException { // get HTTP request headers final HttpRequestPacket request = (HttpRequestPacket) requestContent.getHttpHeader(); try { if (doServerUpgrade(ctx, requestContent)) { return ctx.getInvokeAction(); // not a WS request, pass to the next filter. } setIdleTimeout(ctx); } catch (HandshakeException e) { ctx.write(composeHandshakeError(request, e)); throw e; } requestContent.recycle(); return ctx.getStopAction(); }
protected WebSocketFilter createWebSocketFilter() { return new WebSocketFilter(timeout); } }
@Override protected NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException { return handleServerHandshake(ctx, content); }
/** * Handle server-side websocket handshake * * @param ctx {@link FilterChainContext} * @param requestContent HTTP message * @throws {@link IOException} */ private NextAction handleServerHandshake(final FilterChainContext ctx, final HttpContent requestContent) throws IOException { // get HTTP request headers final HttpRequestPacket request = (HttpRequestPacket) requestContent.getHttpHeader(); try { if (doServerUpgrade(ctx, requestContent)) { return ctx.getInvokeAction(); // not a WS request, pass to the next filter. } setIdleTimeout(ctx); } catch (HandshakeException e) { ctx.write(composeHandshakeError(request, e)); throw e; } requestContent.recycle(); return ctx.getStopAction(); }
protected WebSocketFilter createWebSocketFilter() { return new WebSocketFilter(timeout); } }
@Override protected NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException { return handleServerHandshake(ctx, content); }
/** * Handle server-side websocket handshake * * @param ctx {@link FilterChainContext} * @param requestContent HTTP message * @throws {@link IOException} */ private NextAction handleServerHandshake(final FilterChainContext ctx, final HttpContent requestContent) throws IOException { // get HTTP request headers final HttpRequestPacket request = (HttpRequestPacket) requestContent.getHttpHeader(); try { if (doServerUpgrade(ctx, requestContent)) { return ctx.getInvokeAction(); // not a WS request, pass to the next filter. } setIdleTimeout(ctx); } catch (HandshakeException e) { ctx.write(composeHandshakeError(request, e)); throw e; } requestContent.recycle(); return ctx.getStopAction(); }
protected WebSocketFilter createWebSocketFilter() { return new WebSocketFilter(timeout); } }
@Override protected NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException { return handleServerHandshake(ctx, content); }
protected WebSocketFilter createWebSocketFilter() { return new WebSocketFilter(timeout); } }
@Override protected NextAction handleHandshake(FilterChainContext ctx, HttpContent content) throws IOException { return handleServerHandshake(ctx, content); }
doDefaultTransportConfig(); fcb.add(new WebSocketFilter());
doDefaultTransportConfig(); fcb.add(new WebSocketFilter());