Set default transport and application buffer sizes (#1964)

This commit is contained in:
James Newton-King 2018-04-12 18:23:00 +12:00 committed by GitHub
parent 7563ccae20
commit d4773e831c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -9,14 +9,18 @@ namespace Microsoft.AspNetCore.Http.Connections
{
public class HttpConnectionOptions
{
// Selected because this is the default value of PipeWriter.PauseWriterThreshold.
// There maybe the opportunity for performance gains by tuning this default.
private const int DefaultPipeBufferSize = 32768;
public HttpConnectionOptions()
{
AuthorizationData = new List<IAuthorizeData>();
Transports = HttpTransports.All;
WebSockets = new WebSocketOptions();
LongPolling = new LongPollingOptions();
TransportMaxBufferSize = 0;
ApplicationMaxBufferSize = 0;
TransportMaxBufferSize = DefaultPipeBufferSize;
ApplicationMaxBufferSize = DefaultPipeBufferSize;
}
public IList<IAuthorizeData> AuthorizationData { get; }