Platform SDK: Synchronization Manager

IsDestinationReachable

Determines if the specified destination can be reached and provides Quality of Connection (QOC) information for the destination.

Bool IsDestinationReachable(
  LPCSTR lpszDestination,    // Pointer to string specifying destination
  LPQOCINFO lpQOCInfo        // Pointer to Quality of Connection information
);

Parameters

lpszDestination
Pointer to a string that specifies the destination. The destination can be an IP address, a UNC name, or an URL.
lpQOCInfo
Pointer to the QOCINFO structure that receives the Quality of Connection (QOC) information. You can supply a NULL pointer if the QOC information is not desired.

Return Values

TRUE
The destination can be reached.
FALSE
Call GetLastError to determine the reason why the destination cannot be reached.

Remarks

This function is used by client applications to determine the QOC information before proceeding with network operations. For standalone computers that are directly connected to the network through a network card or remote access server (RAS), this function generates minimal network traffic with RPC calls to the nearest router. For computers that are part of a network where the destination can be reached using RAS or a network gateway, this function pings to the destination to generate accurate QOC information.

Notes  This function is only available for TCP/IP connections.

The caller supplies the buffer for the QOCINFO structure and must release this memory when it is no longer needed.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 5 or later).
  Windows 95/98: Requires Windows 95 or later (with Internet Explorer 5 or later).
  Header: Declared in Sensapi.h.
  Library: Use Sensapi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

IsNetworkAlive, QOCINFO, About System Event Notification Service