MessageWebSocket.Control Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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:
- MaxMessageSize - The maximum message size, in bytes, for a WebSocket message to be configured on the MessageWebSocket object.
- MessageType - The WebSocket message type to be configured on a MessageWebSocket object for write operations.
- OutboundBufferSizeInBytes - The size, in bytes, of the send buffer to be used for sending data on a MessageWebSocket object.
- ProxyCredential - The credential to use to authenticate to the proxy server through HTTP header authentication using a MessageWebSocket object.
- ServerCredential - The credential to use to authenticate to the WebSocket server through HTTP header authentication using a MessageWebSocket object.
- 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.
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.