-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Reimplement APM UDP Socket methods on top of task variants and consolidate related tests #47781
Conversation
This reverts commit 56cd081.
Tagging subscribers to this area: @dotnet/ncl Issue DetailsContributes to #43845.
@geoffkizer PTAL.
|
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.
For creating the Memories be consistent and always use the extension method?
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Outdated
Show resolved
Hide resolved
SocketError errorCode = SocketError.SocketError; | ||
try | ||
Task<SocketReceiveMessageFromResult> t = ReceiveMessageFromAsync(new Memory<byte>(buffer, offset, size), socketFlags, remoteEP).AsTask(); | ||
if (t.IsCompletedSuccessfully) |
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.
I don't understand why we need to do this. We should at least add a comment explaining this. (Similarly below)
I assume all the deleted ArgumentValidationTests got migrated to tests in the appropriate test file? Seems like it would be nice to do the same for other tests in ArgumentValidationTests.... not for this PR of course. |
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.
Just the one issue re remoteEP handling in Begin below... this is probably just a matter of adding a comment, but I'd like to understand it before we merge.
@geoffkizer added some comments. Here is test code checking the mentioned historical behavior, it would fail without the runtime/src/libraries/System.Net.Sockets/tests/FunctionalTests/ReceiveMessageFrom.cs Lines 317 to 327 in fa54293
It wouldn't make sense to pass |
Yeah, this is the case, I went through existing tests carefully to make sure there is no loss in coverage.
I have a One Note document listing Sockets.Tests debt (including the existence of |
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Yeah, that seems good. |
Yeah, this behavior is pretty weird -- I think this is counter to the standard IAsyncResult pattern. Thanks for clarifying why we need to do this. |
A couple of the DualMode SendTo tests are failing, can you look at these? |
@geoffkizer it's the same test failing everywhere (I was lazy to run outerloop locally). The cause is that Since the issue is not specific to |
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
@geoffkizer I pushed a workaround for the test failure (b3e035e). Is the PR is OK to merge in it's current form? |
Yep, LGTM |
Contributes to #43845.
(Begin|End)(SendTo|ReceiveFrom|ReceiveMessageFrom)
on top of the new Task-based variants, and deletes unused codeArgumentValidationTests.cs
toSendTo.cs
,ReceiveFrom.cs
andReceiveMessageFrom.cs
, and extends coverage. Note that the new test code does not validateArgumentException.ParamName
, since it's very inconsistent across all the overloads.@geoffkizer PTAL.