This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Socket: don't perform RST close on Dispose when user called Shutdown #41250
Socket: don't perform RST close on Dispose when user called Shutdown #41250
Changes from 2 commits
1b4a6cf
e51acbd
e6cddbf
2959d2b
0faf564
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm having trouble following what abortive vs canAbort means. Can you clarify?
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.
Before this PR,
TryUnblockSocket
always performed an abortive (that is :Connection reset by peer) close.We're changing to take into account if the user has called
Socket.Shutdown
.canAbort
tellsTryUnblockSocket
if it can do an abortive close.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.
But TryUnblockSocket was already taking a
bool abortive
argument. If it always performed an abortive close, what was the purpose of that argument?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.
There is a special case for Sockets that don't have the CLOEXEC flag set:
corefx/src/System.Net.Sockets/src/System/Net/Sockets/SafeSocketHandle.Unix.cs
Lines 379 to 381 in 485441f
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'm still struggling here, @tmds. Are you saying that both
canAbort
andabortive
mean "do an abortive close", but they communicate that information to different parts of the stack? The names are too close to be meaningful.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 missed this comment.
canAbort
contains whether aCloseAsIs
that was called withabortive: false
, can become a aninnerSocket.Close
withabortive: true
.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'll remove
canAbort
and replace it with!hasShutdownSend
.