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);
}
}
Aggregations