Http connection does not work for C++ client and C# server in gRPc

56 Views Asked by At

for few hours i fight with issue, that gRPC Server for C# does not get messages from C++ Client on virtual mashine, but messages from the same Client in C# and host OS, works properly here are properties

C# server: OS- Windows 10

int listenerPort = 2137;
listener = new Server {
                Services = { ClientListener.BindService(new ClientListenerServer(this)) },
                Ports = { new ServerPort("0.0.0.0", listenerPort, ServerCredentials.Insecure) }
            };

C++ client: OS- Ubuntu

auto channel=grpc::CreateChannel("192.168.26.1:2137", grpc::InsecureChannelCredentials());
auto stub=ClientListener::NewStub(channel);

C# client: OS- Windows

using var channel = GrpcChannel.ForAddress("http://192.168.26.1:2137");
var client= new ConsoleApp1.ClientListener.ClientListenerClient(channel);

I tried at least few configurations to reach c# server from c++ but everything failed. When C# client worked everytime. I don't know where error can be in C++ code, and why it isn't work.

I missed to add, in opossite way (C++ server in Ubuntu VM and C# client in Windows Host System) configuration works properly

1

There are 1 best solutions below

0
On

ANSWER I found out problem... C# server did not work for 192.168.26.1 address which was used in communication with VM (and which was send in communication in other side)... But it worked for ethernet IP 10.4.1.189. Anyone can explain why?