Share via


HostNameSortOptions Enum

Definition

Options for how a list of EndpointPair objects is sorted.

This enumeration supports a bitwise combination of its member values.

public enum class HostNameSortOptions
/// [System.Flags]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class HostNameSortOptions
[System.Flags]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum HostNameSortOptions
var value = Windows.Networking.HostNameSortOptions.none
Public Enum HostNameSortOptions
Inheritance
HostNameSortOptions
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Fields

Name Value Description
None 0

Sort a list of EndpointPair objects by the default criteria used the system which is to minimize connection delays.

OptimizeForLongConnections 2

Sort a list of EndpointPair objects to optimize for long connections.

Remarks

The HostNameSortOptions enumeration affects how a list of EndpointPair objects are sorted.

Given an array of sorted address pairs, the None value returns a sorted list ordering the EndpointPair entries such that pairs with least tried source and destination addresses are prioritized over pairs whose addresses have been tried before and were unsuccessful. The goal is to minimize the connection establishment delay by trying EndpointPair entries with unique addresses first. This might result in less efficient address pairs to be preferred over efficient ones when considering network transfer speeds for long running connections, but that is considered less important than minimizing connection delays for short connections.

For example, if EndpointPair objects can have source addresses of S1 or S2 and destination addresses of D1 or D2, then by default if S1+D1 is the first EndpointPair tried and the connection fails, then S2+D2 is the second pair that would be tried. If the S1+D1 connection fails, the problem might be with either S1 or D1. So the safest option to minimize connection establishment delays would be to try S2+D2 when S1+D1 fails. For activities such as web browsing where speed of getting a connection established dominates, that is most likely the behavior you want.

However if the application is streaming media for a long time, you might be willing to accept a few initial failed connection attempts until you find a more efficient path for transferring data. That would use a different order for sorting. The OptimizeForLongConnections enumeration value would be used for this case. With this setting if S1+D1 fails, then S1+D2 or S2+D1 would be tried next.

Applies to

See also