Click or drag to resize

NetworkDiscovererMulticast(DiscoveryHandler, Int32) Method

Sends a multicast discovery packet.

Namespace: Zebra.Sdk.Printer.Discovery
Assembly: SdkApi.Core (in SdkApi.Core.dll) Version: 3.0.3271
Syntax
public static void Multicast(
	DiscoveryHandler discoveryHandler,
	int hops
)

Parameters

discoveryHandler  DiscoveryHandler
A DiscoveryHandler instance that is used to handle discovery events (e.g. found a printer, errors, discovery finished).
hops  Int32
The number of hops.
Exceptions
ExceptionCondition
DiscoveryExceptionIf an error occurs while starting the discovery (errors during discovery will be sent via DiscoveryError(String).
Remarks
This method will invoke the FoundPrinter(DiscoveredPrinter) method for each printer that is found during discovery. DiscoveryFinished will be invoked when the discovery is finished and DiscoveryError(String) will be invoked when any errors are encountered during discovery. When DiscoveryError(String) is invoked, the discovery will be canceled and DiscoveryFinished will not be invoked.

If a printer responds to the discovery request more than once, the FoundPrinter(DiscoveredPrinter) method will only be invoked on the first occurrence.

For Android users : some extra code is required to obtain a multicast lock. See the example in Multicast(DiscoveryHandler, Int32, Int32)
See Also