Skip to content

Commit

Permalink
Properly cascade cancelation during connect by name
Browse files Browse the repository at this point in the history
  • Loading branch information
rokonec committed Jul 9, 2024
1 parent 01e3d29 commit 5e25367
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,13 @@ internal void SetResults(Exception exception, int bytesTransferred, SocketFlags
{
_socketError = socketException.SocketErrorCode;
}
else if (exception is OperationCanceledException)
{
// Preserver information about the cancellation
// when it is canceled at non Socket operation.
// It will be later used to throw the right exception.
_socketError = SocketError.OperationAborted;
}
else
{
_socketError = SocketError.SocketError;
Expand Down

0 comments on commit 5e25367

Please sign in to comment.