Servient.create constructor

Servient.create({
  1. List<ProtocolClientFactory>? clientFactories,
  2. ServerSecurityCallback? serverSecurityCallback,
  3. ContentSerdes? contentSerdes,
  4. List<DiscoveryConfiguration>? discoveryConfigurations,
})

Creates a new Servient.

The Servient can be pre-configured with Lists of clientFactories and discoveryConfigurations. However, it is also possible to dynamically addClientFactorys and removeClientFactorys at runtime.

If you want to support a custom media type not already included in the ContentSerdes class, a custom contentSerdes object can be passed as an argument.

Implementation

factory Servient.create({
  List<ProtocolClientFactory>? clientFactories,
  ServerSecurityCallback? serverSecurityCallback,
  ContentSerdes? contentSerdes,
  List<DiscoveryConfiguration>? discoveryConfigurations,
}) {
  return InternalServient(
    clientFactories: clientFactories,
    serverSecurityCallback: serverSecurityCallback,
    contentSerdes: contentSerdes,
    discoveryConfigurations: discoveryConfigurations,
  );
}