-
Notifications
You must be signed in to change notification settings - Fork 5.3k
add Memory<byte> support in SendPacketElements and SendPacketsAsync #46975
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Memory<byte> support in SendPacketElements and SendPacketsAsync #46975
Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes #45267 @antonfirsov @stephentoub @dotnet/ncl
|
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SendPacketsElement.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/src/System/Net/Sockets/SendPacketsElement.cs
Show resolved
Hide resolved
antonfirsov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few concerns regarding tests, otherwise looks good.
I would add at least one test that uses NativeMemoryManager to wrap an actual pointer into ReadOnlyMemory<byte> & apply custom some offset + length there to stress that behavior too.
src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs
Outdated
Show resolved
Hide resolved
…cketsElement.cs Co-authored-by: Stephen Toub <[email protected]>
|
There are also a bunch of tests marked as [Outerloop] that don't need to be, as far as I can tell. Will remove this. |
…endpacketelementsmemory
|
Feedback addressed. Please take a look. |
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
antonfirsov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| return new ElementWithMemoryManager(new SendPacketsElement(memoryManager.Memory.Slice(offset, count)), memoryManager); | ||
| } | ||
|
|
||
| private static ElementWithMemoryManager CreateElementForBuffer(BufferType bufferType, int size) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Fixes #45267
@antonfirsov @stephentoub @dotnet/ncl