StreamSocket.GetEndpointPairsAsync StreamSocket.GetEndpointPairsAsync StreamSocket.GetEndpointPairsAsync StreamSocket.GetEndpointPairsAsync StreamSocket.GetEndpointPairsAsync Method

Definition

Overloads

GetEndpointPairsAsync(HostName, String) GetEndpointPairsAsync(HostName, String) GetEndpointPairsAsync(HostName, String) GetEndpointPairsAsync(HostName, String) GetEndpointPairsAsync(HostName, String)

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

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

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

public : static IAsyncOperation<IVectorView<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, Platform::String remoteServiceName)
static IAsyncOperation<IVectorView<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, winrt::hstring remoteServiceName) const;
public static IAsyncOperation<IReadOnlyList<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, String remoteServiceName)
Public Shared Function GetEndpointPairsAsync(remoteHostName As HostName, remoteServiceName As String) As IAsyncOperation<IReadOnlyList<EndpointPair>>(Of IVectorView)
Windows.Networking.Sockets.StreamSocket.getEndpointPairsAsync(remoteHostName, remoteServiceName).done( /* Your success and error handlers */ );
Parameters
remoteHostName
HostName HostName HostName

The hostname of a service. The service might actually be hosted on multiple services, so that a DNS lookup returns multiple IP addresses for the various servers. This method returns one endpoint pair for each of the servers found by a DNS lookup.

remoteServiceName
String String String

The name or port number of a remote service. Note that different servers might support the named service on different physical ports, so not all of the returned endpoints will use the same service port number.

Returns
IAsyncOperation<IReadOnlyList<EndpointPair>> IAsyncOperation<IReadOnlyList<EndpointPair>> IAsyncOperation<IReadOnlyList<EndpointPair>>

An asynchronous lookup operation. On successful completion, the returned list contains one EndpointPair for each remote host found, with one end point being one of the remote hosts and the other being the local host.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This method gets a list of possible EndpointPair objects that can be used by a StreamSocket to send data to a remote network destination using TCP. 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 StreamSocket can use the list returned by this 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

GetEndpointPairsAsync(HostName, String, HostNameSortOptions) GetEndpointPairsAsync(HostName, String, HostNameSortOptions) GetEndpointPairsAsync(HostName, String, HostNameSortOptions) GetEndpointPairsAsync(HostName, String, HostNameSortOptions) 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)
static IAsyncOperation<IVectorView<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, winrt::hstring remoteServiceName, HostNameSortOptions sortOptions) const;
public static IAsyncOperation<IReadOnlyList<EndpointPair>> GetEndpointPairsAsync(HostName remoteHostName, String remoteServiceName, HostNameSortOptions sortOptions)
Public Shared Function GetEndpointPairsAsync(remoteHostName As HostName, remoteServiceName As String, sortOptions As HostNameSortOptions) As IAsyncOperation<IReadOnlyList<EndpointPair>>(Of IVectorView)
Windows.Networking.Sockets.StreamSocket.getEndpointPairsAsync(remoteHostName, remoteServiceName, sortOptions).done( /* Your success and error handlers */ );
Parameters
remoteHostName
HostName HostName HostName

The remote hostname or IP address.

remoteServiceName
String String String

The remote service name or UDP port.

sortOptions
HostNameSortOptions HostNameSortOptions HostNameSortOptions

The sort order to use when returning the list.

Returns
IAsyncOperation<IReadOnlyList<EndpointPair>> IAsyncOperation<IReadOnlyList<EndpointPair>> IAsyncOperation<IReadOnlyList<EndpointPair>>

A list of EndpointPair objects.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

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

A StreamSocket can use the list returned by this 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