Skip to content

Commit 5d42918

Browse files
rzikmMihaZupan
andauthored
Do not rethrow from SocketsTestServerAPM.OnAccept (#114964)
* Do not rethrow from SocketTestServerAPM.OnAccept * Update src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs Co-authored-by: Miha Zupan <[email protected]> * Update src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs --------- Co-authored-by: Miha Zupan <[email protected]>
1 parent 6d5f8e4 commit 5d42918

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/libraries/Common/tests/System/Net/Sockets/SocketTestServerAPM.cs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,9 @@ private void OnAccept(IAsyncResult result)
5151
{
5252
client = _socket.EndAccept(result);
5353
}
54-
catch (SocketException e)
54+
catch (SocketException)
5555
{
56-
if (_disposed ||
57-
e.SocketErrorCode == SocketError.OperationAborted ||
58-
e.SocketErrorCode == SocketError.Interrupted)
59-
{
60-
return;
61-
}
62-
63-
throw;
56+
return;
6457
}
6558
catch (ObjectDisposedException)
6659
{
@@ -81,16 +74,8 @@ private void OnAccept(IAsyncResult result)
8174
{
8275
_socket.BeginAccept(OnAccept, null);
8376
}
84-
catch (SocketException e)
77+
catch (SocketException)
8578
{
86-
if (_disposed ||
87-
e.SocketErrorCode == SocketError.OperationAborted ||
88-
e.SocketErrorCode == SocketError.Interrupted)
89-
{
90-
return;
91-
}
92-
93-
throw;
9479
}
9580
catch (ObjectDisposedException)
9681
{

0 commit comments

Comments
 (0)