StreamWebSocketControl class

Applies to Windows and Windows Phone

Provides socket control data on a StreamWebSocket object.

Syntax


public ref class StreamWebSocketControl sealed : IWebSocketControl

Attributes

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

Members

The StreamWebSocketControl class has these types of members:

Methods

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

Properties

The StreamWebSocketControl class has these properties.

PropertyAccess typeDescription

NoDelay

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

OutboundBufferSizeInBytes

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

ProxyCredential

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

ServerCredential

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

SupportedProtocols

Read-onlyGets 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.

 

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.



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.


For more information about using StreamWebSocketControl, see How to use advanced WebSocket controls (HTML) and How to use advanced WebSocket 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.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

internetClient
privateNetworkClientServer

See also

Other
Connecting with WebSockets (HTML)
Connecting with WebSockets (XAML)
How to use advanced WebSocket controls (HTML)
How to use advanced WebSocket controls (XAML)
Reference
StreamWebSocketControl
StreamWebSocketInformation
Samples
Connecting with WebSockets sample
ControlChannelTrigger StreamWebSocket sample
StreamWebSocket
How to use advanced WebSocket controls

 

 

Show:
© 2014 Microsoft