diff --git a/snippets/csharp/System.Net.Http/SocketsHttpHandler/ConnectCallback/program.cs b/snippets/csharp/System.Net.Http/SocketsHttpHandler/ConnectCallback/program.cs index feec305fbb7..3ee31d37fe3 100644 --- a/snippets/csharp/System.Net.Http/SocketsHttpHandler/ConnectCallback/program.cs +++ b/snippets/csharp/System.Net.Http/SocketsHttpHandler/ConnectCallback/program.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System; using System.Net; using System.Net.Http; using System.Net.Sockets; @@ -14,6 +13,8 @@ static async Task Main() handler.ConnectCallback = async (ctx, ct) => { + DnsEndPoint dnsEndPoint = ctx.DnsEndPoint; + IPAddress[] addresses = await Dns.GetHostAddressesAsync(dnsEndPoint.Host, dnsEndPoint.AddressFamily, ct); var s = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true }; try { @@ -21,7 +22,8 @@ static async Task Main() s.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, 5); s.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, 5); s.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 5); - await s.ConnectAsync(ctx.DnsEndPoint, ct); + + await s.ConnectAsync(addresses, dnsEndPoint.Port, ct); return new NetworkStream(s, ownsSocket: true); } catch diff --git a/xml/System.IO.Pipes/NamedPipeServerStream.xml b/xml/System.IO.Pipes/NamedPipeServerStream.xml index 3f2c7bc806b..733055dc0ad 100644 --- a/xml/System.IO.Pipes/NamedPipeServerStream.xml +++ b/xml/System.IO.Pipes/NamedPipeServerStream.xml @@ -1377,7 +1377,7 @@ This example is for the server process, which uses the object in a parent process, which then creates multiple threads that wait for objects to connect. After a client is connected, it supplies a file name to the server and the contents of that file are read and sent back to the client. Because the impersonates the client when opening the file, the client can request only files that it has sufficient permissions to open. diff --git a/xml/System/Uri.xml b/xml/System/Uri.xml index fc06c487ac8..a7931c9bafd 100644 --- a/xml/System/Uri.xml +++ b/xml/System/Uri.xml @@ -1971,9 +1971,7 @@ If you used an escaped string to construct this instance (for example, `"http:// is . - Note: In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead. - - The length of exceeds 32766 characters. + .NET Framework only: The length of exceeds 32766 characters. @@ -2129,9 +2127,7 @@ If you used an escaped string to construct this instance (for example, `"http:// is . - The length of exceeds 32766 characters. - - Note: In .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead. + .NET Framework only: The length of exceeds 32766 characters.