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(
  HGROUP        hGroup,
  ULONG         cAddresses,
  PPEER_ADDRESS pAddresses
);

Parameters

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.

cAddresses

The total number of PEER_ADDRESS structures pointed to by pAddresses.

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

   
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