Can anyone give tips what is the problem here:
My gRPC client sometimes takes about 3 or higher seconds to connect to the 
gRPC server. What could be the potential reasons? Here is my sample code. 
Server side: 
std::string server_address("0.0.0.0:" + port);
service_ = std::make_unique<XXXerviceImpl>(this);

grpc::ServerBuilder builder;
builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
builder.RegisterService(service_.get());
server_ = builder.BuildAndStart();
Client side: 
channel_ = grpc::CreateChannel("127.0.0.1:50123",
grpc::InsecureChannelCredentials());

while (true) {
bool connected = channel_->WaitForConnected(gpr_time_add(
gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(50, GPR_TIMESPAN)));
if (connected) {
break;
}
}
Here the logs: 
grpc logs 
<https://u3d-my.sharepoint.cn/:f:/g/personal/nairu_fan_unity_cn/Eh6tOp6AKRhCvIWEVIiIB74Bv4DzkfXD3AOI9XzyTUXGWA?e=qFqCKs>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/grpc-io/a466b0a2-a069-421e-af86-d250f539b834n%40googlegroups.com.

Reply via email to