StreamWebSocketControl StreamWebSocketControl StreamWebSocketControl StreamWebSocketControl StreamWebSocketControl Class

Definition

Provides socket control data on a StreamWebSocket object.

public : sealed class StreamWebSocketControl : IStreamWebSocketControl, IWebSocketControl, IWebSocketControl2
struct winrt::Windows::Networking::Sockets::StreamWebSocketControl : IStreamWebSocketControl, IWebSocketControl, IWebSocketControl2
public sealed class StreamWebSocketControl : IStreamWebSocketControl, IWebSocketControl, IWebSocketControl2
Public NotInheritable Class StreamWebSocketControl Implements IStreamWebSocketControl, IWebSocketControl, IWebSocketControl2
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
privateNetworkClientServer internetClient

Remarks

The StreamWebSocketControl class provides access to advanced socket control data on a StreamWebSocket object.

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

Any changes to the StreamWebSocketControl property values must be set before the StreamWebSocket is connected. As a result if you need to make changes to the NoDelay, OutboundBufferSizeInBytes, ProxyCredential, ServerCredential, or SupportedProtocols properties, then these changes must occur before a successful call to the ConnectAsync method on the StreamWebSocket.

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

var clientWebSocket = new Windows.Networking.Sockets.StreamWebSocket();

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

// Set noDelay to false so that the Nagle algorithm is not disabled
clientWebSocket.control.noDelay = false;

// Now you can call the ConnectAsync method to connect the StreamWebSocket.
using namespace Windows::Networking::Sockets;

StreamWebSocket^ clientWebSocket = ref new StreamWebSocket();

// Get the current setting for this option
// This isn't required, but it shows how to get the current setting 
bool currentSetting = clientWebSocket->Control->NoDelay;

// Set NoDelay to false so that the Nagle algorithm is not disabled
clientWebSocket->Control->NoDelay = false;

// Now you can call the ConnectAsync method to connect the StreamWebSocket.
using Windows.Networking.Sockets;

StreamWebSocket clientWebSocket = new StreamWebSocket();

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

// Set NoDelay to false so that the Nagle algorithm is not disabled
clientWebSocket.Control.NoDelay = false;

// Now you can call the ConnectAsync method to connect the StreamWebSocket.

For more information about using StreamWebSocketControl, see How to use advanced WebSocket controls and How to use advanced WebSocket controls .

Properties

ActualUnsolicitedPongInterval ActualUnsolicitedPongInterval ActualUnsolicitedPongInterval ActualUnsolicitedPongInterval ActualUnsolicitedPongInterval

Allows an app to get the actual unsolicited WebSocket PONG interval.

ClientCertificate ClientCertificate ClientCertificate ClientCertificate ClientCertificate

Gets the certificate provided by the client when a secure WebSocket connection has been established.

DesiredUnsolicitedPongInterval DesiredUnsolicitedPongInterval DesiredUnsolicitedPongInterval DesiredUnsolicitedPongInterval DesiredUnsolicitedPongInterval

Allows an app to get and set the desired unsolicited WebSocket PONG interval.

IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors IgnorableServerCertificateErrors

Gets a list of ignorable server certificate errors. Get this list and add ChainValidationResult values for server certificate errors that you wish to ignore during the secure WebSocket (wss:// protocol) server certificate validation process.

NoDelay NoDelay NoDelay NoDelay NoDelay

A value that indicates whether the Nagle algorithm is used on a StreamWebSocket object.

OutboundBufferSizeInBytes OutboundBufferSizeInBytes OutboundBufferSizeInBytes OutboundBufferSizeInBytes OutboundBufferSizeInBytes

The size, in bytes, of the send buffer to be used for sending data on a StreamWebSocket object.

ProxyCredential ProxyCredential ProxyCredential ProxyCredential ProxyCredential

The credential to use to authenticate to the proxy server through HTTP header authentication using a StreamWebSocket object.

ServerCredential ServerCredential ServerCredential ServerCredential ServerCredential

The credential to use to authenticate to the WebSocket server through HTTP header authentication using a StreamWebSocket object.

SupportedProtocols SupportedProtocols SupportedProtocols SupportedProtocols SupportedProtocols

Gets a collection that can be used to add a list of supported sub-protocols that will be advertised to the server during the connect handshake.

See Also