Platforms to show: All Mac Windows Linux Cross-Platform

Back to DNSServiceBrowseMBS class.

DNSServiceBrowseMBS.ServiceBrowse(Flags as Integer, InterfaceIndex as Integer, ErrorCode as Integer, ServiceName as string, RegType as string, Domain as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Network MBS Network Plugin 5.0 ✅ Yes ✅ Yes ❌ No ❌ No
New service found or lost one.
Example
sub ServiceBrowse(Flags as Integer, InterfaceIndex as Integer, ErrorCode as Integer, ServiceName as string, RegType as string, Domain as string)
// example for event implementation

const kDNSServiceFlagsAdd = 2
const kDNSServiceFlagsRemove = 0
const kDNSServiceFlagsMoreComing = 1
const kDNSServiceFlagsFinished = 0

dim Added as boolean = bitwiseAnd(flags, kDNSServiceFlagsAdd) = kDNSServiceFlagsAdd
dim Removed as boolean = bitwiseAnd(flags, kDNSServiceFlagsAdd) = kDNSServiceFlagsRemove

dim MoreComing as boolean = bitwiseAnd(flags, kDNSServiceFlagsMoreComing) = kDNSServiceFlagsMoreComing
dim Finished as boolean = bitwiseAnd(flags, kDNSServiceFlagsMoreComing) = kDNSServiceFlagsFinished

// work with the booleans to decide what to do.

end sub

Values for flags:
kDNSServiceFlagsAdd= 2
kDNSServiceFlagsRemove= 0 (i.e. bit not set)
kDNSServiceFlagsMoreComing= 1
kDNSServiceFlagsFinished= 0 (i.e. bit not set)

MoreComing indicates to a Browse callback that another result is queued. Applications should not update their UI to display browse results when the MoreComing flag is set, instead deferring the update until the callback's flag is Finished.

Starting a new query from within this event on the same object can cause problems. Better you create a new instance for another query if you need one.

InterfaceIndex can be kInterfaceIndexLocalOnly, kInterfaceIndexAny or a positive index for the interface index (1 = first device).
For interface indexes, please also check NetworkInterfaceMBS class.

The items on this page are in the following plugins: MBS Network Plugin.


The biggest plugin in space...