Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Bonjour.Register

Register a service.

Component Version macOS Windows Linux Server iOS SDK
Bonjour 8.4 ✅ Yes ✅ Yes ❌ No ✅ Yes, on macOS and Windows ✅ Yes
MBS( "Bonjour.Register"; Name; Type; Domain; Host; Port )   More

Parameters

Parameter Description Example
Name If non-empty, specifies the service name to be registered.
Most applications will not specify a name, in which case the computer name is used
If a name is specified, it must be 1-63 bytes of UTF-8 text.
If the name is longer than 63 bytes it will be automatically truncated to a legal length.
Type The service type followed by the protocol, separated by a dot (e.g. "_ftp._tcp"). The service type must be an underscore, followed by 1-14 characters, which may be letters, digits, or hyphens.
The transport protocol must be "_tcp" or "_udp". New service types should be registered at http://www.dns-sd.org/ServiceTypes.html.
"_test._tcp"
Domain If non-empty, specifies the domain on which to advertise the service.
Most applications will not specify a domain, instead automatically registering in the default domain(s).
Host If non-empty, specifies the SRV target host name.
Most applications will not specify a host, instead automatically using the machine'sdefault host name(s).
Port The port, in network byte order, on which the service accepts connections.
Pass 0 for a "placeholder" service (i.e. a service that will not be discovered by browsing, but will cause a name conflict if another client tries to register that same name). Most clients will not use placeholder services.
1234

Result

Returns OK or error.

Description

Register a service.
This service is discovered via Bonjour.Browse function.

Examples

Register test service:

MBS( "Bonjour.Register"; "Test"; "_test._tcp"; ""; ""; 1234 )

See also

This function checks for a license.

Created 31st July 2018, last changed 31st July 2018


Bonjour.JSON - Bonjour.RegisteredName