Package io.undertow.spdy

Examples of io.undertow.spdy.SpdyChannel$SpdyControlMessageExceptionHandler


                        }
                    }
                }

                private SpdyClientConnection createSpdyChannel() {
                    return new SpdyClientConnection(new SpdyChannel(connection, bufferPool, null, new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 1024, 1024)));
                }
            });
            sslConnection.getSourceChannel().resumeReads();
        } catch (IOException e) {
            listener.failed(e);
View Full Code Here


                        return;
                    }
                    buffer.getResource().flip();
                    if (SPDY_3.equals(selected) || SPDY_3_1.equals(selected)) {
                        //cool, we have a spdy connection.
                        SpdyChannel channel = new SpdyChannel(this.channel, bufferPool, buffer, heapBufferPool);
                        free = false;
                        channel.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                        channel.resumeReceives();
                        return;
                    } else if (HTTP_1_1.equals(selected) || res > 0) {
                        if (delegate == null) {
                            UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                            IoUtils.safeClose(channel);
                            return;
                        }
                        channel.getSourceChannel().setReadListener(null);
                        if (res > 0) {
                            PushBackStreamSourceConduit pushBackStreamSourceConduit = new PushBackStreamSourceConduit(channel.getSourceChannel().getConduit());
                            channel.getSourceChannel().setConduit(pushBackStreamSourceConduit);
                            pushBackStreamSourceConduit.pushBack(buffer);
                            free = false;
                        }
                        delegate.handleEvent(channel);
                        return;
                    } else if (res == 0) {
                        channel.getSourceChannel().resumeReads();
                        return;
                    }
                }

            } catch (IOException e) {
View Full Code Here

        String existing = (String) sslEngine.getSession().getValue(PROTOCOL_KEY);
        //resuming an existing session, no need for NPN
        if (existing != null) {
            UndertowLogger.REQUEST_LOGGER.debug("Resuming existing session, not doing NPN negotiation");
            if(existing.equals(SPDY_3_1) || existing.equals(SPDY_3)) {
                SpdyChannel sc = new SpdyChannel(channel, bufferPool, new ImmediatePooled<>(ByteBuffer.wrap(new byte[0])), heapBufferPool);
                sc.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                sc.resumeReceives();
            } else {
                if (delegate == null) {
                    UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                    IoUtils.safeClose(channel);
                    return;
View Full Code Here

                    buffer.getResource().flip();
                    if (SPDY_3.equals(selected) || SPDY_3_1.equals(selected)) {

                        NextProtoNego.remove(JsseXnioSsl.getSslEngine((SslConnection) channel));
                        //cool, we have a spdy connection.
                        SpdyChannel channel = new SpdyChannel(this.channel, bufferPool, buffer, heapBufferPool);
                        Integer idleTimeout = undertowOptions.get(UndertowOptions.IDLE_TIMEOUT);
                        if(idleTimeout != null && idleTimeout > 0) {
                            channel.setIdleTimeout(idleTimeout);
                        }
                        free = false;
                        channel.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                        channel.resumeReceives();
                        return;
                    } else if (HTTP_1_1.equals(selected) || res > 0) {
                        NextProtoNego.remove(JsseXnioSsl.getSslEngine((SslConnection) channel));
                        if (delegate == null) {
                            UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                            IoUtils.safeClose(channel);
                            return;
                        }
                        channel.getSourceChannel().setReadListener(null);
                        if (res > 0) {
                            PushBackStreamSourceConduit pushBackStreamSourceConduit = new PushBackStreamSourceConduit(channel.getSourceChannel().getConduit());
                            channel.getSourceChannel().setConduit(pushBackStreamSourceConduit);
                            pushBackStreamSourceConduit.pushBack(buffer);
                            free = false;
                        }
                        delegate.handleEvent(channel);
                        return;
                    } else if (res == 0) {
                        channel.getSourceChannel().resumeReads();
                        return;
                    }
                }

            } catch (IOException e) {
View Full Code Here

        String existing = (String) sslEngine.getSession().getValue(PROTOCOL_KEY);
        //resuming an existing session, no need for NPN
        if (existing != null) {
            UndertowLogger.REQUEST_LOGGER.debug("Resuming existing session, not doing NPN negotiation");
            if(existing.equals(SPDY_3_1) || existing.equals(SPDY_3)) {
                SpdyChannel sc = new SpdyChannel(channel, bufferPool, new ImmediatePooled<>(ByteBuffer.wrap(new byte[0])), heapBufferPool, false);
                sc.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                sc.resumeReceives();
            } else {
                if (delegate == null) {
                    UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                    IoUtils.safeClose(channel);
                    return;
View Full Code Here

                    buffer.getResource().flip();
                    if (SPDY_3.equals(selected) || SPDY_3_1.equals(selected)) {

                        NextProtoNego.remove(JsseXnioSsl.getSslEngine((SslConnection) channel));
                        //cool, we have a spdy connection.
                        SpdyChannel channel = new SpdyChannel(this.channel, bufferPool, buffer, heapBufferPool, false);
                        Integer idleTimeout = undertowOptions.get(UndertowOptions.IDLE_TIMEOUT);
                        if(idleTimeout != null && idleTimeout > 0) {
                            channel.setIdleTimeout(idleTimeout);
                        }
                        free = false;
                        channel.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                        channel.resumeReceives();
                        return;
                    } else if (HTTP_1_1.equals(selected) || res > 0) {
                        NextProtoNego.remove(JsseXnioSsl.getSslEngine((SslConnection) channel));
                        if (delegate == null) {
                            UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                            IoUtils.safeClose(channel);
                            return;
                        }
                        channel.getSourceChannel().setReadListener(null);
                        if (res > 0) {
                            PushBackStreamSourceConduit pushBackStreamSourceConduit = new PushBackStreamSourceConduit(channel.getSourceChannel().getConduit());
                            channel.getSourceChannel().setConduit(pushBackStreamSourceConduit);
                            pushBackStreamSourceConduit.pushBack(buffer);
                            free = false;
                        }
                        delegate.handleEvent(channel);
                        return;
                    } else if (res == 0) {
                        channel.getSourceChannel().resumeReads();
                        return;
                    }
                }

            } catch (IOException e) {
View Full Code Here

        }

    }

    private static SpdyClientConnection createSpdyChannel(StreamConnection connection, Pool<ByteBuffer> bufferPool) {
        SpdyChannel spdyChannel = new SpdyChannel(connection, bufferPool, null, new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 8192, 8192), true);
        return new SpdyClientConnection(spdyChannel);
    }
View Full Code Here

        String existing = (String) sslEngine.getSession().getValue(PROTOCOL_KEY);
        //resuming an existing session, no need for NPN
        if (existing != null) {
            UndertowLogger.REQUEST_LOGGER.debug("Resuming existing session, not doing NPN negotiation");
            if(existing.equals(SPDY_3_1) || existing.equals(SPDY_3)) {
                SpdyChannel sc = new SpdyChannel(channel, bufferPool, new ImmediatePooled<>(ByteBuffer.wrap(new byte[0])), heapBufferPool);
                sc.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                sc.resumeReceives();
            } else {
                if (delegate == null) {
                    UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                    IoUtils.safeClose(channel);
                    return;
View Full Code Here

                    buffer.getResource().flip();
                    if (SPDY_3.equals(selected) || SPDY_3_1.equals(selected)) {

                        NextProtoNego.remove(JsseXnioSsl.getSslEngine((SslConnection) channel));
                        //cool, we have a spdy connection.
                        SpdyChannel channel = new SpdyChannel(this.channel, bufferPool, buffer, heapBufferPool);
                        free = false;
                        channel.getReceiveSetter().set(new SpdyReceiveListener(rootHandler, getUndertowOptions(), bufferSize));
                        channel.resumeReceives();
                        return;
                    } else if (HTTP_1_1.equals(selected) || res > 0) {
                        NextProtoNego.remove(JsseXnioSsl.getSslEngine((SslConnection) channel));
                        if (delegate == null) {
                            UndertowLogger.REQUEST_IO_LOGGER.couldNotInitiateSpdyConnection();
                            IoUtils.safeClose(channel);
                            return;
                        }
                        channel.getSourceChannel().setReadListener(null);
                        if (res > 0) {
                            PushBackStreamSourceConduit pushBackStreamSourceConduit = new PushBackStreamSourceConduit(channel.getSourceChannel().getConduit());
                            channel.getSourceChannel().setConduit(pushBackStreamSourceConduit);
                            pushBackStreamSourceConduit.pushBack(buffer);
                            free = false;
                        }
                        delegate.handleEvent(channel);
                        return;
                    } else if (res == 0) {
                        channel.getSourceChannel().resumeReads();
                        return;
                    }
                }

            } catch (IOException e) {
View Full Code Here

        }

    }

    private static SpdyClientConnection createSpdyChannel(StreamConnection connection, Pool<ByteBuffer> bufferPool) {
        SpdyChannel spdyChannel = new SpdyChannel(connection, bufferPool, null, new ByteBufferSlicePool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, 8192, 8192));
        return new SpdyClientConnection(spdyChannel);
    }
View Full Code Here

TOP

Related Classes of io.undertow.spdy.SpdyChannel$SpdyControlMessageExceptionHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.