aspnetcore/src/Microsoft.AspNetCore.WebSoc.../WebSocketOptions.cs

31 lines
974 B
C#

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Configuration options for the WebSocketMiddleware
/// </summary>
public class WebSocketOptions
{
public WebSocketOptions()
{
KeepAliveInterval = TimeSpan.FromMinutes(2);
ReceiveBufferSize = 4 * 1024;
}
/// <summary>
/// Gets or sets the frequency at which to send Ping/Pong keep-alive control frames.
/// The default is two minutes.
/// </summary>
public TimeSpan KeepAliveInterval { get; set; }
/// <summary>
/// Gets or sets the size of the protocol buffer used to receive and parse frames.
/// The default is 4kb.
/// </summary>
public int ReceiveBufferSize { get; set; }
}
}