From 440085a29617444b686ddeef2f06def2600e2034 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 31 Oct 2022 20:55:16 +0100 Subject: [PATCH 1/5] delete snippet tags --- .../System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp | 6 ------ .../System.Net.Sockets/TcpClient/Available/newtcpclient.cs | 6 ------ 2 files changed, 12 deletions(-) diff --git a/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp b/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp index 1fc0dcb58d7..86c17e2e7fd 100644 --- a/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp +++ b/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp @@ -64,7 +64,6 @@ ref class TcpClientExamples } // - // static void DoBeginConnect1( String^ host, int port ) { // Connect asynchronously to the specifed host. @@ -79,9 +78,7 @@ ref class TcpClientExamples connectDone->WaitOne(); Console::WriteLine( "Connection established" ); } - // - // // Connect asynchronously to the specifed host. static void DoBeginConnect2( String^ host, int port ) { @@ -95,9 +92,7 @@ ref class TcpClientExamples connectDone->WaitOne(); Console::WriteLine( "Connection established" ); } - // - // // Connect asynchronously to the specifed host. static void DoBeginConnect3( String^ host, int port ) { @@ -110,7 +105,6 @@ ref class TcpClientExamples connectDone->WaitOne(); Console::WriteLine( "Connection established" ); } - // }; int main() diff --git a/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs b/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs index 66f50a4757e..e495e867bf0 100644 --- a/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs +++ b/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs @@ -64,7 +64,6 @@ public static void ConnectCallback(IAsyncResult ar) } // - // public static void DoBeginConnect1(string host, int port) { // Connect asynchronously to the specifed host. @@ -84,9 +83,7 @@ public static void DoBeginConnect1(string host, int port) Console.WriteLine("Connection established"); } - // - // // Connect asynchronously to the specifed host. public static void DoBeginConnect2(string host, int port) { @@ -104,9 +101,7 @@ public static void DoBeginConnect2(string host, int port) Console.WriteLine("Connection established"); } - // - // // Connect asynchronously to the specifed host. public static void DoBeginConnect3(string host, int port) { @@ -124,7 +119,6 @@ public static void DoBeginConnect3(string host, int port) Console.WriteLine("Connection established"); } - // [STAThread] static void Main(string[] args) From 6cbdccb047522f13f0417d990f406fa991d6a3bc Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 31 Oct 2022 20:57:09 +0100 Subject: [PATCH 2/5] BeginConnect - remove examples --- xml/System.Net.Sockets/TcpClient.xml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/xml/System.Net.Sockets/TcpClient.xml b/xml/System.Net.Sockets/TcpClient.xml index fab0f005ff9..ee11d6d1eed 100644 --- a/xml/System.Net.Sockets/TcpClient.xml +++ b/xml/System.Net.Sockets/TcpClient.xml @@ -524,14 +524,7 @@ The `Available` property is a way to determine whether data is queued for readin For detailed information about using the asynchronous programming model, see [Calling Synchronous Methods Asynchronously](/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously). - - -## Examples - The following code example creates a and connects to a remote host. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs" id="Snippet4"::: - + ]]> The parameter is . @@ -597,15 +590,7 @@ The `Available` property is a way to determine whether data is queued for readin For detailed information about using the asynchronous programming model, see [Calling Synchronous Methods Asynchronously](/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously). This method is typically used immediately after a call to the method, which can return multiple IP addresses for a single host. - - - -## Examples - The following code example creates a and connects to a remote host. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs" id="Snippet5"::: - + ]]> The parameter is . @@ -670,14 +655,7 @@ The `Available` property is a way to determine whether data is queued for readin For detailed information about using the asynchronous programming model, see [Calling Synchronous Methods Asynchronously](/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously). - - -## Examples - The following code example creates a and connects to a remote host. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp" id="Snippet6"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs" id="Snippet6"::: - + ]]> The parameter is . From 2361510a9d0d278d23d1182f9009a79bbbdcd96f Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 31 Oct 2022 20:58:43 +0100 Subject: [PATCH 3/5] TcpClient - EndConnect --- .../TcpClient/Available/newtcpclient.cs | 2 -- xml/System.Net.Sockets/TcpClient.xml | 8 -------- 2 files changed, 10 deletions(-) diff --git a/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs b/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs index e495e867bf0..5ffc969fcc2 100644 --- a/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs +++ b/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs @@ -52,7 +52,6 @@ static void DoConnect(string host, int port) } // - // public static ManualResetEvent connectDone = new ManualResetEvent(false); @@ -62,7 +61,6 @@ public static void ConnectCallback(IAsyncResult ar) TcpClient t = (TcpClient)ar.AsyncState; t.EndConnect(ar); } - // public static void DoBeginConnect1(string host, int port) { diff --git a/xml/System.Net.Sockets/TcpClient.xml b/xml/System.Net.Sockets/TcpClient.xml index ee11d6d1eed..15040eca8c0 100644 --- a/xml/System.Net.Sockets/TcpClient.xml +++ b/xml/System.Net.Sockets/TcpClient.xml @@ -1721,14 +1721,6 @@ The `Available` property is a way to determine whether data is queued for readin > [!NOTE] > If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. - - -## Examples - The following code example ends the asynchronous connection attempt. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpClient1/CPP/newtcpclient.cpp" id="Snippet7"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpClient/Available/newtcpclient.cs" id="Snippet7"::: - ]]> The parameter is . From 829554f09656f11c707a567de40d76182efd2278 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 31 Oct 2022 21:05:13 +0100 Subject: [PATCH 4/5] TcpListener - delete sample tags --- .../System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp | 4 ---- .../TcpListener/BeginAcceptSocket/tcpserver.cs | 4 ---- .../System.Net.Sockets.TcpListener1/VB/tcpserver.vb | 8 +++----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp b/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp index 58dab91d423..0a8159bb679 100644 --- a/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp +++ b/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp @@ -31,7 +31,6 @@ namespace TcpListenerExample } // - // // Thread signal. public: static ManualResetEvent^ ClientConnected; @@ -73,9 +72,7 @@ namespace TcpListenerExample // Signal the calling thread to continue. ClientConnected->Set(); } - // - // // Thread signal. public: static ManualResetEvent^ TcpClientConnected; @@ -120,7 +117,6 @@ namespace TcpListenerExample TcpClientConnected->Set(); } - // public: static void Main() diff --git a/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs b/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs index 19ac830d184..3b4261514cd 100644 --- a/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs +++ b/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs @@ -27,7 +27,6 @@ public static void DoStart(TcpListener t, int backlog) } // - // // Thread signal. public static ManualResetEvent clientConnected = new ManualResetEvent(false); @@ -67,9 +66,7 @@ public static void DoAcceptSocketCallback(IAsyncResult ar) // Signal the calling thread to continue. clientConnected.Set(); } - // - // // Thread signal. public static ManualResetEvent tcpClientConnected = new ManualResetEvent(false); @@ -112,7 +109,6 @@ public static void DoAcceptTcpClientCallback(IAsyncResult ar) // Signal the calling thread to continue. tcpClientConnected.Set(); } - // [STAThread] static void Main() diff --git a/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb b/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb index 421167ddfca..396f9587fe2 100644 --- a/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb +++ b/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb @@ -20,7 +20,7 @@ Class newListener Console.WriteLine("started listening") End Sub ' - ' + ' Thread signal. Public Shared clientConnected As New ManualResetEvent(False) @@ -58,8 +58,7 @@ Class newListener ' Signal the calling thread to continue. clientConnected.Set() End Sub - ' - ' + ' Thread signal. Public Shared tcpClientConnected As New ManualResetEvent(False) @@ -98,8 +97,7 @@ Class newListener ' Signal the calling thread to continue. tcpClientConnected.Set() End Sub - - ' + _ Shared Sub Main() Dim listener As New TcpListener(Dns.GetHostAddresses("")(0), 4242) From a4fd79f23bfcad48425a07f0315763f05199da36 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 31 Oct 2022 21:06:34 +0100 Subject: [PATCH 5/5] TcpListener - delete sample references --- xml/System.Net.Sockets/TcpListener.xml | 43 +++----------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/xml/System.Net.Sockets/TcpListener.xml b/xml/System.Net.Sockets/TcpListener.xml index 8cb9db43152..00c85cb1c1e 100644 --- a/xml/System.Net.Sockets/TcpListener.xml +++ b/xml/System.Net.Sockets/TcpListener.xml @@ -795,16 +795,7 @@ > [!NOTE] > This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - - -## Examples - The following code example demonstrates the use of the method to create and connect a socket. The callback delegate calls the method to end the asynchronous request. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb" id="Snippet4"::: - + ]]> An error occurred while attempting to access the socket. @@ -867,16 +858,7 @@ > [!NOTE] > This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - - -## Examples - The following code example demonstrates the use of the method to create and connect a socket. The callback delegate calls the method to end the asynchronous request. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb" id="Snippet5"::: - + ]]> An error occurred while attempting to access the socket. @@ -977,16 +959,7 @@ > [!NOTE] > This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - - -## Examples - The following code example demonstrates the use of the method to create and connect a socket. The callback delegate calls the method to end the asynchronous request. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp" id="Snippet4"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb" id="Snippet4"::: - + ]]> The underlying has been closed. @@ -1051,15 +1024,7 @@ > [!NOTE] > This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - -## Examples - The following code example demonstrates the use of the method to create and connect a socket. The callback delegate calls the method to end the asynchronous request. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/cpp/tcpserver.cpp" id="Snippet5"::: - :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/TcpListener/BeginAcceptSocket/tcpserver.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/System.Net.Sockets.TcpListener1/VB/tcpserver.vb" id="Snippet5"::: - + ]]>