public synchronized Http2HeadersStreamSinkChannel createStream ( HeaderMap requestHeaders ) throws IOException { if ( ! isClient ( ) ) { throw UndertowMessages . MESSAGES . headersStreamCanOnlyBeCreatedByClient ( ) ; } if ( ! isOpen ( ) ) { throw UndertowMessages . MESSAGES . channelIsClosed ( ) ; } sendConcurrentStreamsAtomicUpdater . incrementAndGet ( this ) ; if ( sendMaxConcurrentStreams > 0 && sendConcurrentStreams > sendMaxConcurrentStreams ) { throw UndertowMessages . MESSAGES . streamLimitExceeded ( ) ; } int streamId = streamIdCounter ; streamIdCounter += 2 ; Http2HeadersStreamSinkChannel http2SynStreamStreamSinkChannel = new Http2HeadersStreamSinkChannel ( this , streamId , requestHeaders ) ; currentStreams . put ( streamId , new StreamHolder ( http2SynStreamStreamSinkChannel ) ) ; return http2SynStreamStreamSinkChannel ; }
Creates a strema using a HEADERS frame