* Obsolete ReceiveBufferSize in WebSocketOptions * Update reference * Update obsolete messages
This commit is contained in:
parent
e21fb7e93c
commit
bb2e2a9160
|
|
@ -13,6 +13,7 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
public WebSocketOptions() { }
|
public WebSocketOptions() { }
|
||||||
public System.Collections.Generic.IList<string> AllowedOrigins { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
public System.Collections.Generic.IList<string> AllowedOrigins { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||||
public System.TimeSpan KeepAliveInterval { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
public System.TimeSpan KeepAliveInterval { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||||
|
[System.ObsoleteAttribute("Setting this property has no effect. It will be removed in a future version.")]
|
||||||
public int ReceiveBufferSize { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
public int ReceiveBufferSize { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -22,6 +23,7 @@ namespace Microsoft.AspNetCore.WebSockets
|
||||||
{
|
{
|
||||||
public ExtendedWebSocketAcceptContext() { }
|
public ExtendedWebSocketAcceptContext() { }
|
||||||
public System.TimeSpan? KeepAliveInterval { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
public System.TimeSpan? KeepAliveInterval { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||||
|
[System.ObsoleteAttribute("Setting this property has no effect. It will be removed in a future version.")]
|
||||||
public int? ReceiveBufferSize { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
public int? ReceiveBufferSize { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||||
public override string SubProtocol { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
public override string SubProtocol { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,10 @@ namespace Microsoft.AspNetCore.WebSockets
|
||||||
public class ExtendedWebSocketAcceptContext : WebSocketAcceptContext
|
public class ExtendedWebSocketAcceptContext : WebSocketAcceptContext
|
||||||
{
|
{
|
||||||
public override string SubProtocol { get; set; }
|
public override string SubProtocol { get; set; }
|
||||||
|
|
||||||
|
[Obsolete("Setting this property has no effect. It will be removed in a future version.")]
|
||||||
public int? ReceiveBufferSize { get; set; }
|
public int? ReceiveBufferSize { get; set; }
|
||||||
|
|
||||||
public TimeSpan? KeepAliveInterval { get; set; }
|
public TimeSpan? KeepAliveInterval { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,14 +131,9 @@ namespace Microsoft.AspNetCore.WebSockets
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeSpan keepAliveInterval = _options.KeepAliveInterval;
|
TimeSpan keepAliveInterval = _options.KeepAliveInterval;
|
||||||
int receiveBufferSize = _options.ReceiveBufferSize;
|
|
||||||
var advancedAcceptContext = acceptContext as ExtendedWebSocketAcceptContext;
|
var advancedAcceptContext = acceptContext as ExtendedWebSocketAcceptContext;
|
||||||
if (advancedAcceptContext != null)
|
if (advancedAcceptContext != null)
|
||||||
{
|
{
|
||||||
if (advancedAcceptContext.ReceiveBufferSize.HasValue)
|
|
||||||
{
|
|
||||||
receiveBufferSize = advancedAcceptContext.ReceiveBufferSize.Value;
|
|
||||||
}
|
|
||||||
if (advancedAcceptContext.KeepAliveInterval.HasValue)
|
if (advancedAcceptContext.KeepAliveInterval.HasValue)
|
||||||
{
|
{
|
||||||
keepAliveInterval = advancedAcceptContext.KeepAliveInterval.Value;
|
keepAliveInterval = advancedAcceptContext.KeepAliveInterval.Value;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
public WebSocketOptions()
|
public WebSocketOptions()
|
||||||
{
|
{
|
||||||
KeepAliveInterval = TimeSpan.FromMinutes(2);
|
KeepAliveInterval = TimeSpan.FromMinutes(2);
|
||||||
ReceiveBufferSize = 4 * 1024;
|
|
||||||
AllowedOrigins = new List<string>();
|
AllowedOrigins = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,6 +27,7 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
/// Gets or sets the size of the protocol buffer used to receive and parse frames.
|
/// Gets or sets the size of the protocol buffer used to receive and parse frames.
|
||||||
/// The default is 4kb.
|
/// The default is 4kb.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("Setting this property has no effect. It will be removed in a future version.")]
|
||||||
public int ReceiveBufferSize { get; set; }
|
public int ReceiveBufferSize { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -36,4 +36,4 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IList<string> AllowedOrigins { get; }
|
public IList<string> AllowedOrigins { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue