镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add QuicStream.Priority property - #17

Closed
ManickaP wants to merge 1 commit into
mainfrom
quic-stream-priority
Closed

ManickaP wants to merge 1 commit into
mainfrom
quic-stream-priority

Conversation

@ManickaP

Copy link
Copy Markdown
Owner

Note

This PR was created with the assistance of GitHub Copilot.

Implements the API-approved design from dotnet#90281.

Changes

Adds a settable Priority property (byte) and a DefaultPriority constant (0x7F) to QuicStream, per the approved API shape:

namespace System.Net.Quic;

public partial class QuicStream
{
    public const byte DefaultPriority = 0x7F;
    public byte Priority { get; set; }
}
  • Getter returns the cached field value (no P/Invoke).
  • Setter calls SetMsQuicParameter(QUIC_PARAM_STREAM_PRIORITY, (ushort)((value << 8) | 0xFF)) to translate the byte range to MsQuic's ushort range.
  • Throws ObjectDisposedException after disposal.

Tests

Four new tests in QuicStreamTests.cs:

  • Priority_DefaultValue — both client/server streams default to 0x7F
  • Priority_SetGet (Theory) — roundtrip for min, 1, default, max values
  • Priority_SetMultipleTimes — changing priority multiple times
  • Priority_ThrowsAfterDispose — ObjectDisposedException after disposal

All existing and new tests pass.

Fixes dotnet#90281

Implements the api-approved design from dotnet#90281.
Adds a settable Priority property (byte) to QuicStream with
DefaultPriority const (0x7F). The setter translates the byte value
to MsQuic's ushort priority via (value << 8) | 0xFF.

Includes functional tests for default value, set/get, multiple
sets, and ObjectDisposedException after dispose.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ManickaP ManickaP closed this Apr 22, 2026
@ManickaP
ManickaP deleted the quic-stream-priority branch April 24, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: QUIC stream priority support

1 participant