Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Utilize new APIs in the WebSocket implementation#101953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
CarnaViire merged 19 commits intodotnet:mainfromPaulusParssinen:use-new-apis-in-ws
May 21, 2024

Conversation

@PaulusParssinen
Copy link
Contributor

Use few newer APIs in the managed websocket implementation. Gets rid of little manual endianness bit-twiddling that is common for code beforeBinaryPrimitives.

CarnaViire reacted with heart emoji
@ghostghost added the area-System.Net labelMay 6, 2024
@dotnet-policy-servicedotnet-policy-servicebot added the community-contributionIndicates that the PR has been added by a community member labelMay 6, 2024
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info inarea-owners.md if you want to be subscribed.

@PaulusParssinen
Copy link
ContributorAuthor

PaulusParssinen commentedMay 8, 2024
edited
Loading

Assuming the CI failures are unrelated but the fails were about missing log artifact directory, so I'm rolling the CI roulette one more time.

edit: hooray, finally green

@CarnaViire
Copy link
Member

@zlatanov JFYI

sendBuffer[i]=unchecked((byte)length);
length/=256;
}
BinaryPrimitives.WriteUInt64BigEndian(sendBuffer.AsSpan(2),(ulong)payload.Length);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We do already have a test that would verify it, is that correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not explicitly, but the deflate / inflate tests would hit this and verify its correctness.

CarnaViire reacted with thumbs up emoji
Copy link
ContributorAuthor

@PaulusParssinenPaulusParssinenMay 9, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The testing coverage is dangerously low but a lot of thingswould should have broke if these were wrong, for example the compression tests as said above😅

RFC6455, Section 5.2. quote: "If 126, the following 2 bytes interpreted as a 16-bit unsigned integer are the payload length."
@PaulusParssinenPaulusParssinen marked this pull request as draftMay 9, 2024 20:01
@PaulusParssinen
Copy link
ContributorAuthor

PaulusParssinen commentedMay 9, 2024
edited
Loading

I just realized thatWebSocketValidate.cs is in shared folder, but.. it's not actually imported by any of the projects in the class and only other place it's "synced" to is azure-relay-dotnet?

https://grep.app/search?q=websocketvalidate&filter[lang][0]=C%23&filter[path][0]=src/&filter[repo][0]=Azure/azure-relay-dotnet

Can we move the class toSystem.Net.WebSockets?

edit: Answer is no. (It is used by couple projects. Need to restore the removed method.)

@PaulusParssinenPaulusParssinen marked this pull request as ready for reviewMay 9, 2024 21:27
@zlatanov
Copy link
Contributor

LGTM. Thanks!

PaulusParssinen reacted with heart emoji

Copy link
Member

@CarnaViireCarnaViire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, thanks! (and sorry for the delay)

PaulusParssinen reacted with heart emoji
@CarnaViireCarnaViire merged commite8b89a3 intodotnet:mainMay 21, 2024
@PaulusParssinenPaulusParssinen deleted the use-new-apis-in-ws branchMay 22, 2024 09:13
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull requestMay 30, 2024
* Use BinaryPrimitives in ManagedWebSocket* Use MemoryMarshal.CreateSpan instead of .ctor in WebSocketInflater* Apply PR suggestion* Use BinaryPrimitives in more places* Restore the behavior where mask is stored in machine-endianness* Implementation detail, both would work* Remove unused using directives* Read the payload length as unsigned for 16-bit caseRFC6455, Section 5.2. quote: "If 126, the following 2 bytes interpreted as a 16-bit unsigned integer are the payload length."* Consolidate some validation logic to WebSocketValidata.cs* Use CallerArgumentExpression to flow the parameterName in ValidateArraySegment* Remove unused ValidateBuffer* Use new throw helpers in ValueWebSocketReceiveResult* Use ValueTask.FromException* Revert "Remove unused ValidateBuffer"This reverts commit053f0ac.* Oops* Fix ArgumentNullException for ValidateArraySegment* Revert "Consolidate some validation logic to WebSocketValidata.cs"This reverts commitc515ba9.* Revert ValueWebSocketReceiveResult.ThrowMessageTypeOutOfRange* Revert "Remove unused using directives"This reverts commit820dc04.
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 22, 2024
@karelzkarelz added this to the9.0.0 milestoneJun 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@stephentoubstephentoubstephentoub left review comments

@CarnaViireCarnaViireCarnaViire approved these changes

+1 more reviewer

@zlatanovzlatanovzlatanov approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

area-System.Netcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Milestone

9.0.0

Development

Successfully merging this pull request may close these issues.

5 participants

@PaulusParssinen@CarnaViire@zlatanov@stephentoub@karelz

[8]ページ先頭

©2009-2025 Movatter.jp