Skip to content

Better host resolving errors handling (Channel isn't ready.) #116

Open
@alex-vasenin-peggy

Description

@alex-vasenin-peggy

Guys, I spent an hour figuring out the cause of the following error:

unavailable: "Channel isn't ready."

Turns out, instead of this:

let transport = try! HTTP2ClientTransport.TransportServices(target: .dns(host: "grpc.mydomain.com"), transportSecurity: .tls)

I've been using this:

let transport = try! HTTP2ClientTransport.TransportServices(target: .ipv4(host: "grpc.mydomain.com"), transportSecurity: .tls)

If you expect only IPv4 address in .ipv4(host:) you should crash (or throw) if you get something else, and frankly .ipv4(address:) communicates the idea much better. Sorry for venting out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions