int bound_port=0;
std::string server_address("0.0.0.0:50051");
builder.AddListeningPort(server_address, 
grpc::SslServerCredentials(ssl_options) &bound_port);
builder.RegisterService(&service);
std::unique_ptr server(builder.BuildAndStart());
if(bound_port == 0) { cout<<"port already in use!" << endl; }

I don't know why above code is not work, the bound_port return always is 
50051, I can't get 0 as expected when port already in use.

Thanks for your help in advance!

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/c6f5ef2c-7e14-46aa-8cfb-51a3d461e957n%40googlegroups.com.

Reply via email to