Edit

Share via


Peer.InviteAsyncCancel(Object) Method

Definition

Cancels the invitation that was sent with the InviteAsync(PeerApplication, String, Byte[], Object) method.

public:
 void InviteAsyncCancel(System::Object ^ userToken);
[System.Security.SecurityCritical]
public void InviteAsyncCancel (object userToken);
[<System.Security.SecurityCritical>]
member this.InviteAsyncCancel : obj -> unit
Public Sub InviteAsyncCancel (userToken As Object)

Parameters

userToken
Object

User defined object to pass to the callback of the InviteAsync(PeerApplication, String, Byte[], Object) operation for identification. This required parameter must be unique across all asynchronous invitation operations in progress.

Attributes

Exceptions

The userToken parameter cannot be null.

An asynchronous invitation is not outstanding.

Remarks

Calling this method guarantees the system will cease to wait for a PeerInvitationResponse from the peer associated with the InviteAsync request.

Multiple invitations may be outstanding at any given time. If the InviteAsyncCancel method is called when an asynchronous operation identified by the userToken is not in existence, an exception is thrown. The userToken object must be provided since it is used to track a specific asynchronous call. This host application-supplied object is unique for each invite request.

When this method is used, the InviteCompleted event can still be raised, but the Cancelled property on the associated InviteCompletedEventArgs object will be set to true.

Calling this method requires a PermissionState of Unrestricted.

Applies to

See also