Skip to content

WebSocket keep-alive timeout API #57072

Closed
@BrennanConroy

Description

Background and Motivation

dotnet/runtime is adding an API to control the keep-alive timeout see dotnet/runtime#48729 (comment)
Our WebSocket middleware exposes options to control the websocket options being used so we would want to expose an equivalent option.

Proposed API

namespace Microsoft.AspNetCore.Builder;

public class WebSocketOptions
{
    public TimeSpan KeepAliveInterval { get; set; }
+   public TimeSpan KeepAliveTimeout { get; set; }
}

Usage Examples

builder.AddWebSockets(o =>
{
    o.KeepAliveTimeout = TimeSpan.FromMinutes(1);
});

Alternative Designs

Risks

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions