PeerContact.Invite Method (PeerApplication, String, Byte[])

 

Sends the specified invitation to join into the specified PeerApplication sponsored by the sender.

Namespace:   System.Net.PeerToPeer.Collaboration
Assembly:  System.Net (in System.Net.dll)

[SecurityCriticalAttribute]
public override PeerInvitationResponse Invite(
	PeerApplication applicationToInvite,
	string message,
	byte[] invitationData
)

Parameters

applicationToInvite
Type: System.Net.PeerToPeer.Collaboration.PeerApplication

The PeerApplication for which the invitation is sent.

message
Type: System.String

A message to send to the remote peer along with the application invitation.

invitationData
Type: System.Byte[]

A user-defined data blob to associate with the invitation. Its size can be no more than 16,384 bytes.

Return Value

Type: System.Net.PeerToPeer.Collaboration.PeerInvitationResponse

A PeerInvitationResponse from the peer who received the invitation.

Exception Condition
ArgumentNullException

PeerApplication cannot be null.

ObjectDisposedException

The PeerEndPoint object has been disposed.

PeerToPeerException

The Id for the current application does not exist or is empty.

The caller is not required to sign-in to the System.Net.PeerToPeer.Collaboration infrastructure for this method to complete successfully. A PeerInvitationResponse from the invitee is not the same as the invitee accepting the invitation to collaborate. If an invitation is sent to a remote peer that has not installed the application, the invitation is automatically declined.

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

Notes to Callers:

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

.NET Framework
Available since 3.5
Return to top
Show: