IWSDiscoveryProvider::SetAddressFamily (Compact 2013)
3/26/2014
This method specifies the IP address family (IPv4, IPv6, or both) to search when discovering DPWS devices.
Syntax
HRESULT SetAddressFamily(
DWORD dwAddressFamily
);
Parameters
dwAddressFamily
[in] The address family to search when discovering devices.Note
For a list of possible address family values, see the Remarks section in this topic below.
Return Value
The following table shows the possible error code return values.
Error code |
Description |
---|---|
S_OK |
This method completed successfully. |
E_INVALIDARG |
dwAddressFamily has a value other than WSDAPI_ADDRESSFAMILY_IPV4, WSDAPI_ADDRESSFAMILY_IPV6, or WSDAPI_ADDRESSFAMILY_IPV4 | WSDAPI_ADDRESSFAMILY_IPV6. |
STG_E_INVALIDFUNCTION |
The address family has already been set for this publisher. |
HRESULT_FROM_WIN32 (WSAESOCKTNOSUPPORT) |
The system does not support the address family specified by dwAddressFamily. |
Remarks
This method can be called only once on a provider. This method must be called before a notification sink is attached to the provider. That means SetAddressFamily must be called before IWSDiscoveryProvider::Attach is called on a provider.
Address Family Values
Value |
Meaning |
---|---|
WSDAPI_ADDRESSFAMILY_IPV4 |
Search over IPv4 addresses. |
WSDAPI_ADDRESSFAMILY_IPV6 |
Search over IPv6 addresses. |
WSDAPI_ADDRESSFAMILY_IPV4 | WSDAPI_ADDRESSFAMILY_IPV6 |
Search over IPv4 and IPv6 addresses. |
Requirements
Header |
wsdapi.h |
Library |
wsdapi.lib |