BonsoirService class
Represents a broadcastable network service.
- Implementers
Constructors
-
BonsoirService({required String name, required String type, required int port, Map<
String, String> attributes = const {}}) -
Creates a new Bonsoir service instance.
By default, Bonsoir will normalize your
name
,type
andattributes
in order to conform to RFC 6335. You can ignore this behavior with the BonsoirService.ignoreNorms constructor. -
BonsoirService.fromJson(Map<
String, dynamic> json, {String prefix = 'service.'}) -
Creates a new Bonsoir service instance from the given JSON map.
factory
-
BonsoirService.ignoreNorms({required String name, required String type, required int port, Map<
String, String> attributes = const {}}) -
Creates a new Bonsoir service instance ignoring the norms.
name, type and attributes will not be filtered.
const
Properties
-
attributes
→ Map<
String, String> -
The service attributes.
Will be stored in a TXT record.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- name → String
-
The service name. Should represent what you want to advertise.
This name is subject to change based on conflicts with other services advertised on the same network.
final
- port → int
-
The service port.
Your service should be reachable at the given port using the protocol specified in type.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
The service type.
final
Methods
-
copyWith(
{String? name, String? type, int? port, String? host, Map< String, String> ? attributes}) → BonsoirService - Copies this service instance with the given parameters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
ServiceResolver resolver) → Future< void> - Tries to resolve this service.
-
toJson(
{String prefix = 'service.'}) → Map< String, dynamic> - Converts this JSON service to a JSON map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
dynamic other) → bool -
The equality operator.
override