Skip to content

求教几个疑问 #195

Closed Answered by iyangsj
stopandjoin asked this question in Q&A (问题和回答)
Mar 25, 2024 · 3 comments · 4 replies
Discussion options

You must be logged in to vote
  1. 内部使用的也是C API

  2. Stream优先级由 紧急度增量标记 构成,与HTTP3 优先级机制相同

int quic_stream_new(struct quic_conn_t *conn,
                    uint64_t stream_id,
                    uint8_t urgency,
                    bool incremental);

简述如下:具有数据待发送的流,首先按优先级分为不同队列;相同优先级的流再按 non-incremental/incremental分为两类

  • 发送报文时,优先处理最高优先级流的缓冲数据(即urgency 最小的流),处理完成后才依次处理更低优先级的流

  • 相同优先级的流可能存在多个,按如下方式处理

    • 优先处理non-incremental类型的流缓冲数据,按流ID从小到大顺序进行调度(即流ID更小的缓冲数据发送完,才处理下一个)
    • 然后处理incremental类型的流缓冲数据,按轮转方式依次调度发送(即交错发送不同流的数据)

例:JS会阻塞渲染,使用高优先级及non-incremental标记;而对于渐进式 jpg图片,可以使用普通优先级及incremental标记交错传输

https://github.com/Tencent/tquic/blob/develop/src/connection/stream.rs#L3197-L3207

  1. 开源版本暂不支持连接迁移,后续版本会支持,客户端需要调用migrate()接口将连接迁移到…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@iyangsj
Comment options

Answer selected by stopandjoin
@stopandjoin
Comment options

@stopandjoin
Comment options

@iyangsj
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants