Search in sources :

Example 1 with Http2ClientConnection

use of io.undertow.client.http2.Http2ClientConnection in project undertow by undertow-io.

the class HttpClientConnection method doHttp2Upgrade.

protected void doHttp2Upgrade() {
    try {
        StreamConnection connectedStreamChannel = this.performUpgrade();
        Http2Channel http2Channel = new Http2Channel(connectedStreamChannel, null, bufferPool, null, true, true, options);
        Http2ClientConnection http2ClientConnection = new Http2ClientConnection(http2Channel, currentRequest.getResponseCallback(), currentRequest.getRequest(), currentRequest.getRequest().getRequestHeaders().getFirst(Headers.HOST), clientStatistics, false);
        http2ClientConnection.getCloseSetter().set(new ChannelListener<ClientConnection>() {

            @Override
            public void handleEvent(ClientConnection channel) {
                ChannelListeners.invokeChannelListener(HttpClientConnection.this, HttpClientConnection.this.closeSetter.get());
            }
        });
        http2Delegate = http2ClientConnection;
        //make sure the read listener is immediately invoked, as it may not happen if data is pushed back
        connectedStreamChannel.getSourceChannel().wakeupReads();
        currentRequest = null;
    } catch (IOException e) {
        UndertowLogger.REQUEST_IO_LOGGER.ioException(e);
        safeClose(this);
    }
}
Also used : Http2ClientConnection(io.undertow.client.http2.Http2ClientConnection) Http2Channel(io.undertow.protocols.http2.Http2Channel) Http2ClientConnection(io.undertow.client.http2.Http2ClientConnection) ClientConnection(io.undertow.client.ClientConnection) IOException(java.io.IOException) StreamConnection(org.xnio.StreamConnection)

Aggregations

ClientConnection (io.undertow.client.ClientConnection)1 Http2ClientConnection (io.undertow.client.http2.Http2ClientConnection)1 Http2Channel (io.undertow.protocols.http2.Http2Channel)1 IOException (java.io.IOException)1 StreamConnection (org.xnio.StreamConnection)1