IWebSocketControl IWebSocketControl IWebSocketControl IWebSocketControl Interface

Provides socket control data on an IWebSocket object.

Syntax

Declaration

public interface IWebSocketControlpublic interface IWebSocketControlPublic Interface IWebSocketControlpublic interface IWebSocketControl

Properties summary

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

The credential to use to authenticate to the proxy server through HTTP header authentication using an IWebSocket object.

The credential to use to authenticate to the WebSocket server through HTTP header authentication using an IWebSocket object.

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.

Properties

  • OutboundBufferSizeInBytes
    OutboundBufferSizeInBytes
    OutboundBufferSizeInBytes
    OutboundBufferSizeInBytes

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

    public uint OutboundBufferSizeInBytes { get; set; }public uint OutboundBufferSizeInBytes { get; set; }Public ReadWrite Property OutboundBufferSizeInBytes As uintpublic uint OutboundBufferSizeInBytes { get; set; }

    Property Value

    • uint
      uint
      uint
      uint

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

    Remarks

    This property sets the value of the SO_SNDBUF socket option on the TCP socket used by the IWebSocket. The default value is the local computer's default send buffer size. This value varies based on the system memory size. For more detailed information, see SOL_SOCKET Socket Options in the Windows Sockets documentation.

    For most apps, this property should not be set since this disables TCP send auto-tuning by the system on this IWebSocket object. With TCP send auto-tuning disabled, network throughput is often worse especially on a connections with high latency. So this property should only be used in very specific situations.

    This property must be set before the IWebSocket connection is made. It will not have any effect if set after the connection has been initiated.

  • ProxyCredential
    ProxyCredential
    ProxyCredential
    ProxyCredential

    The credential to use to authenticate to the proxy server through HTTP header authentication using an IWebSocket object.

    public PasswordCredential ProxyCredential { get; set; }public PasswordCredential ProxyCredential { get; set; }Public ReadWrite Property ProxyCredential As PasswordCredentialpublic PasswordCredential ProxyCredential { get; set; }

    Property Value

    Remarks

    The ProxyCredential property must be set before calling the ConnectAsync(Uri) method on the IWebSocket object. An attempt to set the ProxyCredential property after calling the ConnectAsync(Uri) method will result in an error.

  • ServerCredential
    ServerCredential
    ServerCredential
    ServerCredential

    The credential to use to authenticate to the WebSocket server through HTTP header authentication using an IWebSocket object.

    public PasswordCredential ServerCredential { get; set; }public PasswordCredential ServerCredential { get; set; }Public ReadWrite Property ServerCredential As PasswordCredentialpublic PasswordCredential ServerCredential { get; set; }

    Property Value

    Remarks

    The ServerCredential property must be set before calling the ConnectAsync(Uri) method on the IWebSocket object. An attempt to set the ServerCredential property after calling the ConnectAsync(Uri) method will result in an error.

  • 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.

    public IVector<string> SupportedProtocols { get; }public IVector<string> SupportedProtocols { get; }Public ReadOnly Property SupportedProtocols As IVector<string>public IVector<string> SupportedProtocols { get; }

    Property Value

    • A collection that contains the WebSocket sub-protocols supported by the IWebSocket object.

    Remarks

    The SupportedProtocols property contains a collection of WebSocket sub-protocols supported by the IWebSocket object. Before calling the ConnectAsync(Uri) method, additional supported sub-protocol strings can be added to this collection, which will be sent to the server in the "Sec-WebSocket-Protocol" header during the WebSocket handshake. The protocol chosen by the WebSocket server will then be exposed on the Protocol property.

    An attempt to add a sub-protocol to this collection after a successful call to ConnectAsync(Uri) method will result in an error. However, if the ConnectAsync(Uri) method call or the connect operation completes with an error, an appl can update the collection stored in the SupportedProtocols property and retry the ConnectAsync(Uri) method call.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.Networking.Sockets.dll