You could set a timeout while creating the channel.
https://github.com/grpc/grpc/issues/3954 may help you.



On Fri, Oct 6, 2017 at 6:23 PM <[email protected]> wrote:

> Hi all,
>
> Greetings from me! I find in greeter_client.cc
> <https://github.com/grpc/grpc/blob/4bc0b2b6614785ad5064f55f09e1058167fbc55a/examples/cpp/helloworld/greeter_client.cc#L80>
> code:
>
>     GreeterClient greeter(grpc::CreateChannel(
>           "localhost:50051", grpc::InsecureChannelCredentials()));
>
> If I use a fake host name, such as "badhost":
>
>         GreeterClient greeter(grpc::CreateChannel(
>           "badhost:50051", grpc::InsecureChannelCredentials()));
>
> I find the greet_client will block forever at my ArchLinux server.
>
> Is there any method to avoid this case? Thanks very much in advance!
>
> Best Regards
> Nan Xiao
>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/f7ea3e0c-aae8-4c57-bf89-58e3cf6ea3ee%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/f7ea3e0c-aae8-4c57-bf89-58e3cf6ea3ee%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CANODV3%3Df25LPdcR%2BaYsxwSWkXgq5B8a5XAQx1DY2x35VD7HRbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to