HostNameSortOptions enumeration

Applies to Windows and Windows Phone

Options for how a list of EndpointPair objects is sorted.

Syntax


var value = Windows.Networking.HostNameSortOptions.none;

Attributes

[Flags()]
[Version(0x06020000)]

Members

The HostNameSortOptions enumeration has these members.

MemberValueDescription
None | none0

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

OptimizeForLongConnections | optimizeForLongConnections2

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

See also

HostName
EndpointPair
DatagramSocket.GetEndpointPairsAsync(HostName, String, HostNameSortOptions)

 

 

Show:
© 2014 Microsoft