Skip to content

System.Net.Internals.SocketExceptionFactory+ExtendedSocketException #37150

Description

@akalnay

For the code below I was expecting to get a System.Net.Sockets.SocketException, however for a .NET Core 2.2 project it throws a System.Net.Internals.SocketExceptionFactory+ExtendedSocketException:

classProgram{staticasyncTaskMain(){Console.WindowWidth=132;try{awaitConnectClientAsync();}catch(Exceptione){Console.WriteLine($"Caught exception {e.GetType()}.{Environment.NewLine}{e.Message}.");}Console.WriteLine("Press any key to end.");Console.ReadKey();}privatestaticasyncTaskConnectClientAsync(){TcpClienttcpClient=newTcpClient();awaittcpClient.ConnectAsync(IPAddress.Loopback,54321).ConfigureAwait(false);}}

For a .NET Framework 4.7.2 project the same code throws the expected System.Net.Sockets.SocketException.

This issue appears to be similar to 20744, 29081, 30073.

Metadata

Metadata

Assignees

Labels

area-System.Net.SocketsenhancementProduct code improvement that does NOT require public API changes/additions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions