WebSocket::CreateClientWebSocket Method

.NET Framework 4.5

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Allows callers to create a client side WebSocket class which will use the WSPC for framing purposes.

Namespace:  System.Net.WebSockets
Assembly:  System (in System.dll)

static WebSocket^ CreateClientWebSocket(
	Stream^ innerStream, 
	String^ subProtocol, 
	int receiveBufferSize, 
	int sendBufferSize, 
	TimeSpan keepAliveInterval, 
	bool useZeroMaskingKey, 
	ArraySegment<unsigned char> internalBuffer


Type: System.IO::Stream

The connection to be used for IO operations.

Type: System::String

The subprotocol accepted by the client.

Type: System::Int32

The size in bytes of the client WebSocket receive buffer.

Type: System::Int32

The size in bytes of the client WebSocket send buffer.

Type: System::TimeSpan

Determines how regularly a frame is sent over the connection as a keep-alive. Applies only when the connection is idle.

Type: System::Boolean

Indicates whether a random key or a static key (just zeros) should be used for the WebSocket masking.

Type: System::ArraySegment<Byte>

Will be used as the internal buffer in the WPC. The size has to be at least 2 * ReceiveBufferSize + SendBufferSize + 256 + 20 (16 on 32-bit).

.NET Framework

Supported in: 4.6, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft