StreamSocketControl.SerializeConnectionAttempts StreamSocketControl.SerializeConnectionAttempts StreamSocketControl.SerializeConnectionAttempts StreamSocketControl.SerializeConnectionAttempts StreamSocketControl.SerializeConnectionAttempts Property

Definition

A value that indicates whether, when multiple connection attempts are being made, the attempts are made in parallel or serially.

public : Platform::Boolean SerializeConnectionAttempts { get; set; }
bool SerializeConnectionAttempts();

void SerializeConnectionAttempts(bool serializeconnectionattempts);
public bool SerializeConnectionAttempts { get; set; }
Public ReadWrite Property SerializeConnectionAttempts As bool
var bool = streamSocketControl.serializeConnectionAttempts;
streamSocketControl.serializeConnectionAttempts = bool;

Property Value

bool bool bool

When true, at most one connection attempt will be active at one time on this StreamSocket. Default value is false.

Remarks

In certain circumstances, the Windows runtime might attempt to establish a connection using multiple methods in parallel. For example, when StreamSocket attempts a connection and a proxy is detected on the network, it attempts both a direct connection to the specified IP address, and an HTTP CONNECT request (which will connect via the proxy) in parallel. The first connection to succeed is the one that is used by the StreamSocket object. While this works well in most cases, it causes problems with some servers in the case where both connection attempts succeed. If your app is using StreamSocket to connect to a server where the parallel connection method causes problems on the server, you should set SerializeConnectionAttempts to true before connecting. This will ensure that at most one TCP connection attempt is ongoing at any given time, and that only a single connection is used.

Your code must set this property before you call ConnectAsync to attempt to connect. Changing this property value after ConnectAsync has been called results in an exception being thrown.

Note that serializing the connection logic can make establishing the connection take longer.