This method start the advertising process of the service:
The returned promise resolves once the last announcement packet was successfully sent on all network interfaces. The promise might be rejected caused by one of the following reasons:
This method must be called if you want to free the memory used by this service. The service instance is not usable anymore after this call.
If the service is still announced, the service will first be removed from the network by calling end.
This method will remove the advertisement for the service on all connected network interfaces. If the service is still in the Probing state, probing will simply be cancelled.
Promise will resolve once the last goodbye packet was sent out
The fully qualified domain name of the service, used to identify the service.
The current hostname of the service.
Array of subtype pointers (undefined if no subtypes are specified).
The port the service is advertising for. {@code -1} is returned when the port is not yet set.
The service type pointer.
Sets or updates the port of the service. A new port number can only be set when the service is still UNANNOUNCED. Otherwise, an assertion error will be thrown.
The new port number.
Sets or updates the txt of the service.
The updated txt record.
If set to true no announcement is sent for the updated record.
The CiaoService class represents a service which can be advertised on the network.
A service is identified by its fully qualified domain name (FQDN), which consist of the service name, the service type, the protocol and the service domain (.local by default).
The service defines a hostname and a port where the advertised service can be reached.
Additionally, a TXT record can be published, which can contain information (in form of key-value pairs), which might be useful to a querier.
A CiaoService class is always bound to a Responder and can be created using the Responder.createService method in the Responder class. Once the instance is created, advertise can be called to announce the service on the network.