From 2ea043cb59fb5d0b5c75a46bf6be7d0f4b4debae Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 18 Aug 2020 09:31:44 +0200 Subject: [PATCH] change port number in examples to avoid conflict with forbidden port on win --- examples/csharp/Helloworld/GreeterClient/Program.cs | 2 +- examples/csharp/Helloworld/GreeterServer/Program.cs | 2 +- .../HelloworldLegacyCsproj/GreeterClient/Program.cs | 2 +- .../HelloworldLegacyCsproj/GreeterServer/Program.cs | 2 +- .../HelloworldUnity/Assets/Scripts/HelloWorldTest.cs | 4 ++-- examples/csharp/HelloworldXamarin/Droid/MainActivity.cs | 6 +++--- examples/csharp/HelloworldXamarin/iOS/ViewController.cs | 6 +++--- examples/csharp/RouteGuide/RouteGuideClient/Program.cs | 2 +- examples/csharp/RouteGuide/RouteGuideServer/Program.cs | 2 +- examples/csharp/Xds/GreeterClient/Program.cs | 2 +- examples/csharp/Xds/GreeterServer/Program.cs | 2 +- examples/csharp/Xds/README.md | 8 ++++---- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/csharp/Helloworld/GreeterClient/Program.cs b/examples/csharp/Helloworld/GreeterClient/Program.cs index 38e7625d14c..c72ab634aa3 100644 --- a/examples/csharp/Helloworld/GreeterClient/Program.cs +++ b/examples/csharp/Helloworld/GreeterClient/Program.cs @@ -22,7 +22,7 @@ namespace GreeterClient { public static void Main(string[] args) { - Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); + Channel channel = new Channel("127.0.0.1:30051", ChannelCredentials.Insecure); var client = new Greeter.GreeterClient(channel); String user = "you"; diff --git a/examples/csharp/Helloworld/GreeterServer/Program.cs b/examples/csharp/Helloworld/GreeterServer/Program.cs index 2b787ecf0f4..c528a8ff870 100644 --- a/examples/csharp/Helloworld/GreeterServer/Program.cs +++ b/examples/csharp/Helloworld/GreeterServer/Program.cs @@ -30,7 +30,7 @@ namespace GreeterServer class Program { - const int Port = 50051; + const int Port = 30051; public static void Main(string[] args) { diff --git a/examples/csharp/HelloworldLegacyCsproj/GreeterClient/Program.cs b/examples/csharp/HelloworldLegacyCsproj/GreeterClient/Program.cs index 38e7625d14c..c72ab634aa3 100644 --- a/examples/csharp/HelloworldLegacyCsproj/GreeterClient/Program.cs +++ b/examples/csharp/HelloworldLegacyCsproj/GreeterClient/Program.cs @@ -22,7 +22,7 @@ namespace GreeterClient { public static void Main(string[] args) { - Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); + Channel channel = new Channel("127.0.0.1:30051", ChannelCredentials.Insecure); var client = new Greeter.GreeterClient(channel); String user = "you"; diff --git a/examples/csharp/HelloworldLegacyCsproj/GreeterServer/Program.cs b/examples/csharp/HelloworldLegacyCsproj/GreeterServer/Program.cs index 2b787ecf0f4..c528a8ff870 100644 --- a/examples/csharp/HelloworldLegacyCsproj/GreeterServer/Program.cs +++ b/examples/csharp/HelloworldLegacyCsproj/GreeterServer/Program.cs @@ -30,7 +30,7 @@ namespace GreeterServer class Program { - const int Port = 50051; + const int Port = 30051; public static void Main(string[] args) { diff --git a/examples/csharp/HelloworldUnity/Assets/Scripts/HelloWorldTest.cs b/examples/csharp/HelloworldUnity/Assets/Scripts/HelloWorldTest.cs index 2c10f10a144..53bc5fb49f1 100644 --- a/examples/csharp/HelloworldUnity/Assets/Scripts/HelloWorldTest.cs +++ b/examples/csharp/HelloworldUnity/Assets/Scripts/HelloWorldTest.cs @@ -48,7 +48,7 @@ class HelloWorldTest public static HelloReply Greet(string greeting) { - const int Port = 50051; + const int Port = 30051; Server server = new Server { @@ -57,7 +57,7 @@ class HelloWorldTest }; server.Start(); - Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure); + Channel channel = new Channel("127.0.0.1:30051", ChannelCredentials.Insecure); var client = new Greeter.GreeterClient(channel); diff --git a/examples/csharp/HelloworldXamarin/Droid/MainActivity.cs b/examples/csharp/HelloworldXamarin/Droid/MainActivity.cs index 353943ced66..41f4e85e289 100644 --- a/examples/csharp/HelloworldXamarin/Droid/MainActivity.cs +++ b/examples/csharp/HelloworldXamarin/Droid/MainActivity.cs @@ -28,7 +28,7 @@ namespace HelloworldXamarin.Droid [Activity(Label = "HelloworldXamarin", MainLauncher = true, Icon = "@mipmap/icon")] public class MainActivity : Activity { - const int Port = 50051; + const int Port = 30051; int count = 1; protected override void OnCreate(Bundle savedInstanceState) @@ -55,8 +55,8 @@ namespace HelloworldXamarin.Droid server.Start(); // use loopback on host machine: https://developer.android.com/studio/run/emulator-networking - //10.0.2.2:50051 - Channel channel = new Channel("localhost:50051", ChannelCredentials.Insecure); + //10.0.2.2:30051 + Channel channel = new Channel("localhost:30051", ChannelCredentials.Insecure); var client = new Greeter.GreeterClient(channel); string user = "Xamarin " + count; diff --git a/examples/csharp/HelloworldXamarin/iOS/ViewController.cs b/examples/csharp/HelloworldXamarin/iOS/ViewController.cs index c553c1eb483..37c0c55d22e 100644 --- a/examples/csharp/HelloworldXamarin/iOS/ViewController.cs +++ b/examples/csharp/HelloworldXamarin/iOS/ViewController.cs @@ -28,7 +28,7 @@ namespace HelloworldXamarin.iOS { public partial class ViewController : UIViewController { - const int Port = 50051; + const int Port = 30051; int count = 1; public ViewController(IntPtr handle) : base(handle) @@ -42,7 +42,7 @@ namespace HelloworldXamarin.iOS // Perform any additional setup after loading the view, typically from a nib. Button.AccessibilityIdentifier = "myButton"; Button.TouchUpInside += delegate - { + { var title = SayHello(); Button.SetTitle(title, UIControlState.Normal); }; @@ -63,7 +63,7 @@ namespace HelloworldXamarin.iOS }; server.Start(); - Channel channel = new Channel("localhost:50051", ChannelCredentials.Insecure); + Channel channel = new Channel("localhost:30051", ChannelCredentials.Insecure); var client = new Greeter.GreeterClient(channel); string user = "Xamarin " + count; diff --git a/examples/csharp/RouteGuide/RouteGuideClient/Program.cs b/examples/csharp/RouteGuide/RouteGuideClient/Program.cs index accaf0a0ec9..4c718a531b6 100644 --- a/examples/csharp/RouteGuide/RouteGuideClient/Program.cs +++ b/examples/csharp/RouteGuide/RouteGuideClient/Program.cs @@ -215,7 +215,7 @@ namespace Routeguide static void Main(string[] args) { - var channel = new Channel("127.0.0.1:50052", ChannelCredentials.Insecure); + var channel = new Channel("127.0.0.1:30052", ChannelCredentials.Insecure); var client = new RouteGuideClient(new RouteGuide.RouteGuideClient(channel)); // Looking for a valid feature diff --git a/examples/csharp/RouteGuide/RouteGuideServer/Program.cs b/examples/csharp/RouteGuide/RouteGuideServer/Program.cs index a79f8a1a28f..dff6486e590 100644 --- a/examples/csharp/RouteGuide/RouteGuideServer/Program.cs +++ b/examples/csharp/RouteGuide/RouteGuideServer/Program.cs @@ -25,7 +25,7 @@ namespace Routeguide { static void Main(string[] args) { - const int Port = 50052; + const int Port = 30052; var features = RouteGuideUtil.LoadFeatures(); diff --git a/examples/csharp/Xds/GreeterClient/Program.cs b/examples/csharp/Xds/GreeterClient/Program.cs index c6820a8f8d7..7d1286ab341 100644 --- a/examples/csharp/Xds/GreeterClient/Program.cs +++ b/examples/csharp/Xds/GreeterClient/Program.cs @@ -23,7 +23,7 @@ namespace GreeterClient { private class Options { - [Option("server", Default = "localhost:50051", HelpText = "The address of the server")] + [Option("server", Default = "localhost:30051", HelpText = "The address of the server")] public string Server { get; set; } } diff --git a/examples/csharp/Xds/GreeterServer/Program.cs b/examples/csharp/Xds/GreeterServer/Program.cs index e10b1af9f07..5ef9b64e1bc 100644 --- a/examples/csharp/Xds/GreeterServer/Program.cs +++ b/examples/csharp/Xds/GreeterServer/Program.cs @@ -46,7 +46,7 @@ namespace GreeterServer { class Options { - [Option("port", Default = 50051, HelpText = "The port to listen on.")] + [Option("port", Default = 30051, HelpText = "The port to listen on.")] public int Port { get; set; } [Option("hostname", Required = false, HelpText = "The name clients will see in responses. If not specified, machine's hostname will obtain automatically.")] diff --git a/examples/csharp/Xds/README.md b/examples/csharp/Xds/README.md index ce0aa9f7443..1d6370a61f8 100644 --- a/examples/csharp/Xds/README.md +++ b/examples/csharp/Xds/README.md @@ -67,7 +67,7 @@ you to manually test the service. Exercise your server's application-layer service: ```sh -> grpcurl --plaintext -d '{"name": "you"}' localhost:50051 +> grpcurl --plaintext -d '{"name": "you"}' localhost:30051 { "message": "Hello you from jtatt.muc.corp.google.com!" } @@ -76,7 +76,7 @@ Exercise your server's application-layer service: Make sure that all of your server's services are available via reflection: ```sh -> grpcurl --plaintext localhost:50051 list +> grpcurl --plaintext localhost:30051 list grpc.health.v1.Health grpc.reflection.v1alpha.ServerReflection helloworld.Greeter @@ -85,13 +85,13 @@ helloworld.Greeter Make sure that your services are reporting healthy: ```sh -> grpcurl --plaintext -d '{"service": "helloworld.Greeter"}' localhost:50051 +> grpcurl --plaintext -d '{"service": "helloworld.Greeter"}' localhost:30051 grpc.health.v1.Health/Check { "status": "SERVING" } -> grpcurl --plaintext -d '{"service": ""}' localhost:50051 +> grpcurl --plaintext -d '{"service": ""}' localhost:30051 grpc.health.v1.Health/Check { "status": "SERVING"