Share via


WiFiDirectServiceSession.AddDatagramSocketAsync(DatagramSocket) Method

Definition

Adds a DatagramSocket to the session. Your code creates the DatagramSocket before calling this method. Associating a socket to the session causes port information to be sent to the remote device(s) in the session. (In terms of this API, a RemotePortAdded event is raised on each remote device in the session, specifying the UDP protocol.) A remote device can use that information to open a socket and connect back to the local machine.

public:
 virtual IAsyncAction ^ AddDatagramSocketAsync(DatagramSocket ^ value) = AddDatagramSocketAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction AddDatagramSocketAsync(DatagramSocket const& value);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction AddDatagramSocketAsync(DatagramSocket value);
function addDatagramSocketAsync(value)
Public Function AddDatagramSocketAsync (value As DatagramSocket) As IAsyncAction

Parameters

value
DatagramSocket

The DatagramSocket instance to associate with this session.

Returns

An asynchronous association action. Returns on successful completion of the association.

Attributes

Applies to