GrpcOrGrpcWebClientChannel class

A client channel that underneath uses gRPC ClientChannel on all platforms except web, on which it uses GrpcWebClientChannel.

Note that gRPC and gRPC-web are 2 different protocols and server must be able to speak both of them for this to work. Depending on its exact setup, the server may expose gRPC and gRPC-web on the same port (this is the standard setup of AspNetCore implementation for example), on separate ports of the same host (common setup of in-process gRPC-web to gRPC proxies or colocated Envoy gRPC-web to gRPC proxy), or as a completely separate endpoints (for example if Envoy and gRPC server are exposed as different kubernetes services). A corresponding constructor is provided for each case.

Inheritance

Constructors

GrpcOrGrpcWebClientChannel.grpc(Object host, {int port = 443, ChannelOptions options = const ChannelOptions()})
GrpcOrGrpcWebClientChannel.toSeparateEndpoints({required String grpcHost, required int grpcPort, required bool grpcTransportSecure, required String grpcWebHost, required int grpcWebPort, required bool grpcWebTransportSecure})
GrpcOrGrpcWebClientChannel.toSeparatePorts({required String host, required int grpcPort, required bool grpcTransportSecure, required int grpcWebPort, required bool grpcWebTransportSecure})
GrpcOrGrpcWebClientChannel.toSingleEndpoint({required String host, required int port, required bool transportSecure})

Properties

hashCode int
The hash code for this object.
no setterinherited
host Object
Starts the Server with the given options. address can be either a String or an InternetAddress, in the latter case it can be a Unix Domain Socket address.
finalinherited
onConnectionStateChanged Stream<ConnectionState>
Stream of connection state changes
no setterinherited
options ChannelOptions
finalinherited
port int
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createCall<Q, R>(ClientMethod<Q, R> method, Stream<Q> requests, CallOptions options) ClientCall<Q, R>
Initiates a new RPC on this connection.
inherited
createConnection() ClientConnection
inherited
getConnection() Future<ClientConnection>
Returns a connection to this Channel's RPC endpoint.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shutdown() Future<void>
Shuts down this channel.
inherited
terminate() Future<void>
Terminates this channel.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited