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

Applies to Windows and Windows Phone

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

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:
© 2014 Microsoft