Windows Dev Center

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

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.

Syntax


Windows.Networking.Sockets.DatagramSocket.getEndpointPairsAsync(remoteHostName, remoteServiceName).done( /* Your success and error handlers */ );

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.

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 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

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
GetEndpointPairsAsync(HostName, String, HostNameSortOptions)
HostName

 

 

Show:
© 2015 Microsoft