Document Solutions for Imaging
GrapeCity.Documents.Html / GrapeCity.Documents.Html Namespace / LaunchOptions Class / WebSocketFactory Property

In This Topic
    WebSocketFactory Property (LaunchOptions)
    In This Topic
    Gets or sets the optional factory for System.Net.WebSockets.WebSocket implementations.
    Syntax
    'Declaration
     
    Public Property WebSocketFactory As WebSocketFactory
    public WebSocketFactory WebSocketFactory {get; set;}
    Remarks
    If you need to run GcHtmlBrowser on Windows 7, you can use WebSocketFactory to inject %System.Net.WebSockets.Client.Managed:https://www.nuget.org/packages/System.Net.WebSockets.Client.Managed%. WebSocketFactory = async (uri) => { var client = SystemClientWebSocket.CreateClientWebSocket(); if (client is System.Net.WebSockets.Managed.ClientWebSocket managed) { managed.Options.KeepAliveInterval = TimeSpan.FromSeconds(0); await managed.ConnectAsync(uri, default); } else { var coreSocket = client as ClientWebSocket; coreSocket.Options.KeepAliveInterval = TimeSpan.FromSeconds(0); await coreSocket.ConnectAsync(uri, default); } return client; }
    See Also