Skip to content

ClientChannel has no way to trigger a connection to the server if no RPC is being invoked #723

Open
@eladm-ultrawis

Description

@eladm-ultrawis

When using grpc C++, creating a channel immediately creates a connection to the server. I can monitor the ConnectionState and make sure I have a valid connection to the server.

However, when using dart, I could not find a way to force the channel to connect.

 GrpcClient() : channel = createChannel() {
    stub = ultraproto.TelemetryServiceClient(channel);
    // this is never triggered!
    channel.onConnectionStateChanged
        .listen((event) => onConnectionStateChanged(event));

It seems that unless I am explicitly call to one of the stub RPC methods, the channel onConnectionStateChanged event is never triggered.

Questions:

  1. Is this a bug?
  2. Is this behavior documented somewhere?
  3. is there a way to force the channel to connect?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions