How can I check if the RPC client actually made a successfull connection to
the RPC server when I create the channel and stub?
I want to be able to throw an exception or signal if the connection failed.
I am not sure what method qualifies as an "operation" to try here. I don't
want to make any of the RPC calls that we defined, as they all have effects
that will occur....unless the only option is to go implement some "Hi I am
here" RPC method, but that seems silly, no?
void ChatSyncClient::connect(QUrl const& endpoint)
{
disconnect();
// TODO - How do we tell if this fails?
// The comments say a lame channel will be returned, where all
operations fail
// How are we suppose to check right here rather than later?
auto channel =
::grpc::CreateChannel(endpoint.toString().toStdString(),
::grpc::InsecureChannelCredentials());
m_stub = std::make_unique<chat_sync::Chat::Stub>(channel);
emit signalOnConnected();
}
--
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/83c751f4-11d9-47a2-b006-aaa52e89bfddn%40googlegroups.com.