ClientAPIDiscoverByPinging Method |
Discovers cards on the network by pinging the card's expected IP address based on its serial number,
and returns a list of those discovered.
Namespace: RAYLASE.SPICE3.ClientLibAssembly: RAYLASE.SPICE3.ClientLib (in RAYLASE.SPICE3.ClientLib.dll) Version: 3.8.0
Syntaxpublic static CardInfo[] DiscoverByPinging(
int fromSerialNumber,
int toSerialNumber,
int repetitions = 2,
int pingTimeoutMs = 1000,
int maxNumAddressesToPingInParallel = 1000
)
Parameters
- fromSerialNumber Int32
- The serial number where the search should begin from. This should be the lowest serial number in the range to be tested.
- toSerialNumber Int32
- The serial number where the search should end. This should be the highest serial number in the range to be tested.
- repetitions Int32 (Optional)
- The number of times to ping each IP address to ensure reliability of the response. Default is 2.
- pingTimeoutMs Int32 (Optional)
- The timeout duration in milliseconds for each ping attempt. Default is 1000 milliseconds.
- maxNumAddressesToPingInParallel Int32 (Optional)
- The maximum number of IP addresses to ping simultaneously. Default is 1000, but this may be limited by network conditions.
Return Value
CardInfoAn array of
CardInfo objects representing the discovered cards. Each object contains information about a card that responded to the ping.
RemarksThis is an alternative method of discovering cards on private networks, such as peer-to-peer networks, where the UPnP protocol
may be disabled or blocked, for instance by a firewall.
The routine calculates the card's assumed private IP address based on its serial number, and then sends a ping to that address. If the ping
is answered, a connection is attempted to determine whether the responding network device is a SPICE3 card. If the connection succeeds, the IP address
is added to the list, and the next serial number is tested until the specified range of serial numbers is exhausted.
The routine tests up to 10 cards in parallel. Depending on the range of cards to be tested, the search may take several seconds to complete - typically
about 10 seconds for a range of 50 cards.
See Also