NetworkDiscovererDirectedBroadcast Method (DiscoveryHandler, String, Int32)
|
Sends a directed broadcast discovery packet to the subnet specified by ipAddress.
Namespace:
Zebra.Sdk.Printer.Discovery
Assembly:
SdkApi_Core (in SdkApi_Core.dll) Version: 2.14.1989
Syntax public static void DirectedBroadcast(
DiscoveryHandler discoveryHandler,
string ipAddress,
int waitForResponsesTimeout
)
Public Shared Sub DirectedBroadcast (
discoveryHandler As DiscoveryHandler,
ipAddress As String,
waitForResponsesTimeout As Integer
)
public:
static void DirectedBroadcast(
DiscoveryHandler^ discoveryHandler,
String^ ipAddress,
int waitForResponsesTimeout
)
Parameters
- discoveryHandler
- Type: Zebra.Sdk.Printer.DiscoveryDiscoveryHandler
A DiscoveryHandler instance that is used to handle discovery events (e.g. found a printer, errors, discovery finished). - ipAddress
- Type: SystemString
The IP address of the subnet. - waitForResponsesTimeout
- Type: SystemInt32
Time to wait, in milliseconds, before determining that there are no more discovery responses.
Exceptions Remarks
This method will wait up to
waitForResponsesTimeout milliseconds determining that there are no more discovery responses.
Directed broadcasts are defined by the first three subnet octets, followed by 255, such as 192.168.2.255. This method accepts
IP addresses of the form, assuming a subnet of 192.168.2:
- 192.168.2.255
- 192.168.2.1 (last octet will be replaced with 255)
- 192.168.2 (will append 255 for the last octet)
- 192.168.2. (will append 255 for the last octet)
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.
See Also