Udostępnij za pośrednictwem


DatagramSocket.GetEndpointPairsAsync Method

Definition

Overloads

GetEndpointPairsAsync(HostName, String)

Gets a list of EndpointPair objects based on a remote hostname and remote service name that can be used to send datagrams to a remote network destination.

GetEndpointPairsAsync(HostName, String, HostNameSortOptions)

Gets a list of EndpointPair objects based on a remote hostname and remote service name and the sort order to be used.

GetEndpointPairsAsync(HostName, String)

Gets a list of EndpointPair objects based on a remote hostname and remote service name that can be used to send datagrams to a remote network destination.

public:
 static IAsyncOperation<IVectorView<EndpointPair ^> ^> ^ GetEndpointPairsAsync(HostName ^ remoteHostName, Platform::String ^ remoteServiceName);
/// [Windows.Foundation.Metadata.Overload("GetEndpointPairsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<IVectorView<EndpointPair>> GetEndpointPairsAsync(HostName const& remoteHostName, winrt::hstring const& remoteServiceName);
[Windows.Foundation.Metadata.Overload("GetEndpointPairsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<IReadOnlyList<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, string remoteServiceName);
function getEndpointPairsAsync(remoteHostName, remoteServiceName)
Public Shared Function GetEndpointPairsAsync (remoteHostName As HostName, remoteServiceName As String) As IAsyncOperation(Of IReadOnlyList(Of EndpointPair))

Parameters

remoteHostName
HostName

The remote hostname or IP address.

remoteServiceName
String

Platform::String

winrt::hstring

The remote service name or UDP port.

Returns

A list of EndpointPair objects.

Attributes

Windows requirements

App capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The GetEndpointPairsAsync method gets a list of possible EndpointPair objects that can be used by a DatagramSocket to send datagrams to a remote network destination. The returned list is sorted so that the address pairs that are best suited for communication between two peers occur earlier in the list.

A DatagramSocket can use the list returned by the GetEndpointPairsAsync method to try and bind or connect to each EndpointPair object until a connection can be made. An EndpointPair object from the list would be used with the ConnectAsync(EndpointPair) methods

See also

Applies to

GetEndpointPairsAsync(HostName, String, HostNameSortOptions)

Gets a list of EndpointPair objects based on a remote hostname and remote service name and the sort order to be used.

public:
 static IAsyncOperation<IVectorView<EndpointPair ^> ^> ^ GetEndpointPairsAsync(HostName ^ remoteHostName, Platform::String ^ remoteServiceName, HostNameSortOptions sortOptions);
/// [Windows.Foundation.Metadata.Overload("GetEndpointPairsWithSortOptionsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<IVectorView<EndpointPair>> GetEndpointPairsAsync(HostName const& remoteHostName, winrt::hstring const& remoteServiceName, HostNameSortOptions const& sortOptions);
[Windows.Foundation.Metadata.Overload("GetEndpointPairsWithSortOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<IReadOnlyList<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, string remoteServiceName, HostNameSortOptions sortOptions);
function getEndpointPairsAsync(remoteHostName, remoteServiceName, sortOptions)
Public Shared Function GetEndpointPairsAsync (remoteHostName As HostName, remoteServiceName As String, sortOptions As HostNameSortOptions) As IAsyncOperation(Of IReadOnlyList(Of EndpointPair))

Parameters

remoteHostName
HostName

The remote hostname or IP address.

remoteServiceName
String

Platform::String

winrt::hstring

The remote service name or UDP port.

sortOptions
HostNameSortOptions

The sort order to use when returning the list.

Returns

A list of EndpointPair objects.

Attributes

Windows requirements

App capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The GetEndpointPairsAsync method gets a list of possible EndpointPair objects that can be used by a DatagramSocket to connect to a remote network destination. The returned list is sorted based on the sortOptions parameter.

A DatagramSocket can use the list returned by the GetEndpointPairsAsync method to try and bind or connect to each EndpointPair object until a remote destination can be reached. An EndpointPair object from the list would be used with the ConnectAsync(EndpointPair) method.

See also

Applies to