Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StreamSocketControl class

Applies to Windows and Windows Phone

Provides socket control data on a StreamSocket object.

Syntax


var streamSocketControl = control;

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The StreamSocketControl class has these types of members:

Methods

The StreamSocketControl class inherits methods from the Object class (C#/VB/C++).

Properties

The StreamSocketControl class has these properties.

PropertyAccess typeDescription

IgnorableServerCertificateErrors

Read-onlyGet a vector of SSL server errors to ignore when making an SSL connection with a StreamSocket.

KeepAlive

Read/writeA value that indicates whether keep-alive packets are sent to the remote destination on a StreamSocket object.

NoDelay

Read/writeA value that indicates whether the Nagle algorithm is used on a StreamSocket object.

OutboundBufferSizeInBytes

Read/writeThe size, in bytes, of the send buffer to be used for sending data on a StreamSocket object.

OutboundUnicastHopLimit

Read/writeThe hop limit on an outbound packet sent to a unicast IP address by the StreamSocket object.

QualityOfService

Read/writeThe quality of service on a StreamSocket object.

 

Remarks

The StreamSocketControl class provides access to advanced socket control data on a StreamSocket object.

A StreamSocketControl object is automatically created with the parent StreamSocket object. The StreamSocket.Control property provides access to the associated StreamSocketControl object.

Any changes to the property values on the StreamSocketControl must be set before the StreamSocket is connected. As a result if you need to make changes to the IgnorableServerCertificateErrors, KeepAlive, NoDelay, OutboundBufferSizeInBytes , OutboundUnicastHopLimit, or QualityOfService properties, then these changes must occur before a successful call to one of the ConnectAsync methods on the StreamSocket.

The following example creates a StreamSocket, and then demonstrates how to set the NoDelay property to false. Other properties may be set in a similar manner. After this is done, the app can connect the StreamSocket.


var clientSocket = new Windows.Networking.Sockets.StreamSocket();

// Get the current setting for this option
// This isn't required, but it shows how to get the current setting
var currentSetting = clientSocket.Control.noDelay; 

// Set noDelay to false so that the Nagle algorithm is not disabled
clientSocket.control.noDelay = false;
   
// Now you can call the ConnectAsync method to connect the StreamWebSocket.


For more information on using StreamSocketControl, see How to use advanced socket controls (HTML) and How to use advanced socket controls (XAML).

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

ID_CAP_NETWORKING [Windows Phone]
bluetooth.rfcomm

See also

Other resources
Connecting with sockets (HTML)
Connecting with sockets (XAML)
How to use advanced socket controls (HTML)
How to use advanced socket controls (XAML)
Reference
Object
StreamSocket
StreamSocket.Control
StreamSocketInformation
Samples
ControlChannelTrigger StreamSocket sample
StreamSocket sample

 

 

Show:
© 2014 Microsoft