change port number in examples to avoid conflict with forbidden port on win

pull/23879/head
Jan Tattermusch 4 years ago
parent 03582c2690
commit 2ea043cb59
  1. 2
      examples/csharp/Helloworld/GreeterClient/Program.cs
  2. 2
      examples/csharp/Helloworld/GreeterServer/Program.cs
  3. 2
      examples/csharp/HelloworldLegacyCsproj/GreeterClient/Program.cs
  4. 2
      examples/csharp/HelloworldLegacyCsproj/GreeterServer/Program.cs
  5. 4
      examples/csharp/HelloworldUnity/Assets/Scripts/HelloWorldTest.cs
  6. 6
      examples/csharp/HelloworldXamarin/Droid/MainActivity.cs
  7. 4
      examples/csharp/HelloworldXamarin/iOS/ViewController.cs
  8. 2
      examples/csharp/RouteGuide/RouteGuideClient/Program.cs
  9. 2
      examples/csharp/RouteGuide/RouteGuideServer/Program.cs
  10. 2
      examples/csharp/Xds/GreeterClient/Program.cs
  11. 2
      examples/csharp/Xds/GreeterServer/Program.cs
  12. 8
      examples/csharp/Xds/README.md

@ -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";

@ -30,7 +30,7 @@ namespace GreeterServer
class Program
{
const int Port = 50051;
const int Port = 30051;
public static void Main(string[] args)
{

@ -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";

@ -30,7 +30,7 @@ namespace GreeterServer
class Program
{
const int Port = 50051;
const int Port = 30051;
public static void Main(string[] args)
{

@ -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);

@ -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;

@ -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)
@ -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;

@ -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

@ -25,7 +25,7 @@ namespace Routeguide
{
static void Main(string[] args)
{
const int Port = 50052;
const int Port = 30052;
var features = RouteGuideUtil.LoadFeatures();

@ -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; }
}

@ -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.")]

@ -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"

Loading…
Cancel
Save