Home / Function/ connectStream() — netty Function Reference

connectStream() — netty Function Reference

Architecture documentation for the connectStream() function in QuicheQuicChannel.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  856d3247_b041_f0ac_0c9b_22f9f2349213["connectStream()"]
  981bac79_4fa5_9e57_50c8_e12d0b35f6d4["QuicChannelUnsafe"]
  856d3247_b041_f0ac_0c9b_22f9f2349213 -->|defined in| 981bac79_4fa5_9e57_50c8_e12d0b35f6d4
  f8df456e_8e9e_9c94_2def_27f2ca4ba1bb["createStream()"]
  f8df456e_8e9e_9c94_2def_27f2ca4ba1bb -->|calls| 856d3247_b041_f0ac_0c9b_22f9f2349213
  d1677a38_89f2_14d4_c465_cc77599336d5["streamSend0()"]
  856d3247_b041_f0ac_0c9b_22f9f2349213 -->|calls| d1677a38_89f2_14d4_c465_cc77599336d5
  style 856d3247_b041_f0ac_0c9b_22f9f2349213 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java lines 1488–1521

        void connectStream(QuicStreamType type, @Nullable ChannelHandler handler,
                           Promise<QuicStreamChannel> promise) {
            if (!promise.setUncancellable()) {
                return;
            }
            long streamId = idGenerator.nextStreamId(type == QuicStreamType.BIDIRECTIONAL);

            try {
                int res = streamSend0(connection, streamId, Unpooled.EMPTY_BUFFER, false);
                if (res < 0 && res != Quiche.QUICHE_ERR_DONE) {
                    throw Quiche.convertToException(res);
                }
            } catch (Exception e) {
                promise.setFailure(e);
                return;
            }
            if (type == QuicStreamType.UNIDIRECTIONAL) {
                UNI_STREAMS_LEFT_UPDATER.decrementAndGet(QuicheQuicChannel.this);
            } else {
                BIDI_STREAMS_LEFT_UPDATER.decrementAndGet(QuicheQuicChannel.this);
            }
            QuicheQuicStreamChannel streamChannel = addNewStreamChannel(streamId);
            if (handler != null) {
                streamChannel.pipeline().addLast(handler);
            }
            eventLoop().register(streamChannel).addListener((ChannelFuture f) -> {
                if (f.isSuccess()) {
                    promise.setSuccess(streamChannel);
                } else {
                    promise.setFailure(f.cause());
                    streams.remove(streamId);
                }
            });
        }

Domain

Subdomains

Called By

Frequently Asked Questions

What does connectStream() do?
connectStream() is a function in the netty codebase, defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java.
Where is connectStream() defined?
connectStream() is defined in codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicChannel.java at line 1488.
What does connectStream() call?
connectStream() calls 1 function(s): streamSend0.
What calls connectStream()?
connectStream() is called by 1 function(s): createStream.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free