Redigera

Dela via


ContactManager.CreateContactAsync(PeerNearMe, Object) Method

Definition

Creates a contact instance for the specified PeerNearMe object.

public:
 void CreateContactAsync(System::Net::PeerToPeer::Collaboration::PeerNearMe ^ peerNearMe, System::Object ^ userToken);
public void CreateContactAsync (System.Net.PeerToPeer.Collaboration.PeerNearMe peerNearMe, object userToken);
member this.CreateContactAsync : System.Net.PeerToPeer.Collaboration.PeerNearMe * obj -> unit
Public Sub CreateContactAsync (peerNearMe As PeerNearMe, userToken As Object)

Parameters

peerNearMe
PeerNearMe

The PeerNearMe to associate with the new PeerContact instance.

userToken
Object

A user-defined Object that contains information about the CreateContactAsync(PeerNearMe, Object) operation. It will be passed to the callback of the asynchronous operation for identification.

Exceptions

userToken already exists and is in use.

peerNearMe is null.

The PeerNearMe object has been disposed.

  • The specified PeerNearMe instance has no endpoints set on it.

Remarks

Calling this method requires a PermissionState of Unrestricted.

Applies to

See also