Share via


MessageWebSocket.Control Property

Definition

Gets socket control data on a MessageWebSocket object.

public:
 property MessageWebSocketControl ^ Control { MessageWebSocketControl ^ get(); };
MessageWebSocketControl Control();
public MessageWebSocketControl Control { get; }
var messageWebSocketControl = messageWebSocket.control;
Public ReadOnly Property Control As MessageWebSocketControl

Property Value

Socket control data on a MessageWebSocket object.

Remarks

The Control property gets the MessageWebSocketControl instance associated with a MessageWebSocket object.

A MessageWebSocketControl object is automatically created with the parent MessageWebSocket object. The MessageWebSocketControl instance can then be used to get or set control data used by the MessageWebSocket object. These properties on the MessageWebSocketControl instance include the following:

The SupportedProtocols property gets the value of this property and can be called at any time.

The MessageType property can be changed at any time before or after the MessageWebSocket is connected. This allows an app to switch between binary and UTF-8 messages when needed.

The OutboundBufferSizeInBytes property must be set before the MessageWebSocket is connected. Setting this property after the MessageWebSocket is connected has no effect.

Changes to any other property values on the MessageWebSocketControl must be set before the MessageWebSocket is connected. As a result if you need to make changes to the MaxMessageSize, OutboundBufferSizeInBytes, ProxyCredential, or ServerCredential properties, then these changes must occur before a successful call to the ConnectAsync method on the MessageWebSocket.

Applies to

See also