-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-System.Net.SocketsenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additions
Milestone
Description
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:
class Program
{
static async Task Main()
{
Console.WindowWidth = 132;
try
{
await ConnectClientAsync();
}
catch (Exception e)
{
Console.WriteLine($"Caught exception {e.GetType()}.{Environment.NewLine}{e.Message}.");
}
Console.WriteLine("Press any key to end.");
Console.ReadKey();
}
private static async Task ConnectClientAsync()
{
TcpClient tcpClient = new TcpClient();
await tcpClient.ConnectAsync(IPAddress.Loopback, 54321).ConfigureAwait(false);
}
}For a .NET Framework 4.7.2 project the same code throws the expected System.Net.Sockets.SocketException.
Metadata
Metadata
Assignees
Labels
area-System.Net.SocketsenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additions