Windows Dev Center

DatagramSocket.GetEndpointPairsAsync(HostName, String, HostNameSortOptions) | getEndpointPairsAsync(HostName, String, HostNameSortOptions) method

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

Syntax


Public Shared Function GetEndpointPairsAsync(
  remoteHostName As HostName,  
  remoteServiceName As String,  
  sortOptions As HostNameSortOptions 
) As IAsyncOperation(Of IReadOnlyList)

Parameters

remoteHostName

Type: HostName

The remote hostname or IP address.

remoteServiceName

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The remote service name or UDP port.

sortOptions

Type: HostNameSortOptions

The sort order to use when returning the list.

Return value

Type: IAsyncOperation<IVectorView>

A list of EndpointPair objects.

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.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

See also

ConnectAsync(EndpointPair)
DatagramSocket
EndpointPair
GetEndpointPairsAsync(HostName, String)
HostName

 

 

Show:
© 2015 Microsoft