Skip to content

Commit 36dfc94

Browse files
authored
Unify port on client and server in SslStream examples (dotnet#8452)
1 parent 24f9b3f commit 36dfc94

File tree

14 files changed

+35
-11
lines changed

14 files changed

+35
-11
lines changed

snippets/cpp/VS_Snippets_Remoting/NclSslClientAsync/CPP/NclSslClientAsync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public ref class SslTcpClient
263263
serverName = args[ 1 ];
264264

265265
// Create a TCP/IP client socket.
266-
TcpClient^ client = gcnew TcpClient( serverName,80 );
266+
TcpClient^ client = gcnew TcpClient( serverName,5000 );
267267
Console::WriteLine( L"Client connected." );
268268

269269
// Create an SSL stream that will close the client's stream.

snippets/cpp/VS_Snippets_Remoting/NclSslClientSync/CPP/clientsync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ namespace NlsClientSync
136136
//<snippet4>
137137
// Create a TCP/IP client socket.
138138
// machineName is the host running the server application.
139-
TcpClient^ client = gcnew TcpClient(machineName, 8080);
139+
TcpClient^ client = gcnew TcpClient(machineName, 5000);
140140
Console::WriteLine("Client connected.");
141141

142142
// Create an SSL stream that will close

snippets/cpp/VS_Snippets_Remoting/NclSslServerAsync/CPP/NclSslServerAsync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public ref class SslTcpListener
236236
X509Certificate^ serverCertificate = X509Certificate::CreateFromCertFile( args[ 1 ] );
237237

238238
// Create a TCP/IP (IPv4) socket and listen for incoming connections.
239-
TcpListener^ listener = gcnew TcpListener( IPAddress::Any,8080 );
239+
TcpListener^ listener = gcnew TcpListener( IPAddress::Any,5000 );
240240
listener->Start();
241241
while ( true )
242242
{

snippets/cpp/VS_Snippets_Remoting/NclSslServerSync/CPP/NclSslServerSync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ref class SslTcpServer sealed
2626
serverCertificate = X509Certificate::CreateFromCertFile( certificate );
2727

2828
// Create a TCP/IP (IPv4) socket and listen for incoming connections.
29-
TcpListener^ listener = gcnew TcpListener( IPAddress::Any,8080 );
29+
TcpListener^ listener = gcnew TcpListener( IPAddress::Any,5000 );
3030
listener->Start();
3131

3232
while (true)

snippets/csharp/System.Net.Security/LocalCertificateSelectionCallback/Overview/clientasync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public static int Main(string[] args)
192192
// Server name must match the host name and the name on the host's certificate.
193193
serverName = args[0];
194194
// Create a TCP/IP client socket.
195-
TcpClient client = new TcpClient(serverName,80);
195+
TcpClient client = new TcpClient(serverName,5000);
196196
Console.WriteLine("Client connected.");
197197
// Create an SSL stream that will close the client's stream.
198198
SslStream sslStream = new SslStream(

snippets/csharp/System.Net.Security/RemoteCertificateValidationCallback/Overview/clientsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static void RunClient(string machineName, string serverName)
4040
//<snippet4>
4141
// Create a TCP/IP client socket.
4242
// machineName is the host running the server application.
43-
TcpClient client = new TcpClient(machineName,443);
43+
TcpClient client = new TcpClient(machineName,5000);
4444
Console.WriteLine("Client connected.");
4545
// Create an SSL stream that will close the client's stream.
4646
SslStream sslStream = new SslStream(

snippets/csharp/System.Net.Security/SslStream/BeginWrite/serverasync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public static void Main(string[] args)
215215
}
216216
X509Certificate serverCertificate = X509Certificate.CreateFromCertFile(args[0]);
217217
// Create a TCP/IP (IPv4) socket and listen for incoming connections.
218-
TcpListener listener = new TcpListener(IPAddress.Any, 8080);
218+
TcpListener listener = new TcpListener(IPAddress.Any, 5000);
219219
listener.Start();
220220
Console.WriteLine("Listening for clients.");
221221
while (true)

snippets/csharp/System.Net.Security/SslStream/Overview/serversync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void RunServer(string certificate)
2222
{
2323
serverCertificate = X509Certificate.CreateFromCertFile(certificate);
2424
// Create a TCP/IP (IPv4) socket and listen for incoming connections.
25-
TcpListener listener = new TcpListener(IPAddress.Any, 8080);
25+
TcpListener listener = new TcpListener(IPAddress.Any, 5000);
2626
listener.Start();
2727
while (true)
2828
{
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFrameworks>net6.0</TargetFrameworks>
6+
</PropertyGroup>
7+
8+
</Project>

snippets/visualbasic/VS_Snippets_Remoting/NclSslClientAsync/VB/clientasync.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Namespace Examples.Ssl
168168
' Server name must match the host name and the name on the host's certificate.
169169
serverName = args(0)
170170
' Create a TCP/IP client socket.
171-
Dim client As New TcpClient(serverName, 80)
171+
Dim client As New TcpClient(serverName, 5000)
172172
Console.WriteLine("Client connected.")
173173
' Create an SSL stream that will close the client's stream.
174174
Dim sslStream As New SslStream(

0 commit comments

Comments
 (0)