Server class

A gRPC server.

Listens for incoming RPCs, dispatching them to the right Service handler.

Inheritance

Constructors

Server(List<Service> services, [List<Interceptor> interceptors = const <Interceptor>[], List<ServerInterceptor> codecRegistry = const <ServerInterceptor>[], CodecRegistry? errorHandler, GrpcErrorHandler? keepAlive])
Create a server for the given services.
Server.create({required List<Service> services, ServerKeepAliveOptions keepAliveOptions = const ServerKeepAliveOptions(), List<Interceptor> interceptors = const <Interceptor>[], List<ServerInterceptor> serverInterceptors = const <ServerInterceptor>[], CodecRegistry? codecRegistry, GrpcErrorHandler? errorHandler})
Create a server for the given services.

Properties

handlers → Map<ServerTransportConnection, List<ServerHandler>>
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
port → int?
The port that the server is listening on, or null if the server is not active.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

lookupService(String service) → Service?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serve({dynamic address, int? port, ServerCredentials? security, ServerSettings? http2ServerSettings, int backlog = 0, bool v6Only = false, bool shared = false, bool requestClientCertificate = false, bool requireClientCertificate = false}) → Future<void>
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.
serveConnection({required ServerTransportConnection connection, X509Certificate? clientCertificate, InternetAddress? remoteAddress}) → Future<void>
inherited
serveStream(ServerTransportStream stream) → void
serveStream_({required ServerTransportStream stream, X509Certificate? clientCertificate, InternetAddress? remoteAddress, Sink<void>? onDataReceived}) → ServerHandler
override
shutdown() → Future<void>
toString() → String
A string representation of this object.
inherited

Operators

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