PeerGroupConnectByAddress function (p2p.h)

The PeerGroupConnectByAddress function attempts to connect to the peer group that other peers with known IPv6 addresses are participating in. After this function is called successfully, a peer can communicate with other members of the peer group.

Syntax

NOT_BUILD_WINDOWS_DEPRECATE HRESULT PeerGroupConnectByAddress(
  [in] HGROUP        hGroup,
  [in] ULONG         cAddresses,
  [in] PPEER_ADDRESS pAddresses
);

Parameters

[in] hGroup

Handle to the peer group to which a peer intends to connect. This handle is returned by the PeerGroupCreate, PeerGroupOpen,PeerGroupJoin, or PeerGroupPasswordJoin function. This parameter is required.

[in] cAddresses

The total number of PEER_ADDRESS structures pointed to by pAddresses.

[in] pAddresses

Pointer to a list of PEER_ADDRESS structures that specify the endpoints of peers participating in the group.

Return value

Returns S_OK if the operation succeeds. Otherwise, the function returns the following value.

Return code Description
PEER_E_INVALID_GROUP
The handle to the peer group is invalid.
 

Cryptography-specific errors may be returned from the Microsoft RSA Base Provider. These errors are prefixed with CRYPT_* and defined in Winerror.h.

Remarks

If a time-out value for PeerGroupConnectByAddress is not provided in the application, encountering a failure will cause the application to hang. A time-out value of 30 seconds is recommended.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only],Windows XP with SP1 with the Advanced Networking Pack forWindows XP
Minimum supported server None supported
Target Platform Windows
Header p2p.h
Library P2P.lib
DLL P2P.dll

See also

PEER_ADDRESS

PeerGroupConnect

PeerGroupJoin

PeerGroupPasswordJoin