From e826a4edc913a9a71da2ee432b615937a0562d08 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Tue, 25 Jun 2019 09:21:10 +0100 Subject: [PATCH] Max buf len from constants --- rc-num.txt | 2 +- src/Yavsc.Server/Constants.cs | 2 +- src/Yavsc/Startup/Startup.WebSockets.cs | 2 +- src/cli/Commands/Streamer.cs | 3 ++- src/cli/project.json | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rc-num.txt b/rc-num.txt index 75016ea3..64969239 100644 --- a/rc-num.txt +++ b/rc-num.txt @@ -1 +1 @@ -03 +04 diff --git a/src/Yavsc.Server/Constants.cs b/src/Yavsc.Server/Constants.cs index f5997890..e5159d32 100644 --- a/src/Yavsc.Server/Constants.cs +++ b/src/Yavsc.Server/Constants.cs @@ -36,7 +36,7 @@ namespace Yavsc YavscConnectionStringEnvName = "YAVSC_DB_CONNECTION"; - + public const int WebSocketsMaxBufLen = 6*1024; public static readonly long DefaultFSQ = 1024*1024*500; diff --git a/src/Yavsc/Startup/Startup.WebSockets.cs b/src/Yavsc/Startup/Startup.WebSockets.cs index af7b5c08..7b06a305 100644 --- a/src/Yavsc/Startup/Startup.WebSockets.cs +++ b/src/Yavsc/Startup/Startup.WebSockets.cs @@ -17,7 +17,7 @@ namespace Yavsc var webSocketOptions = new WebSocketOptions() { KeepAliveInterval = TimeSpan.FromSeconds(120), - ReceiveBufferSize = 16 * 1024, + ReceiveBufferSize = Constants.WebSocketsMaxBufLen, ReplaceFeature = true }; app.UseWebSockets(webSocketOptions); diff --git a/src/cli/Commands/Streamer.cs b/src/cli/Commands/Streamer.cs index 78d54927..5880b048 100644 --- a/src/cli/Commands/Streamer.cs +++ b/src/cli/Commands/Streamer.cs @@ -7,6 +7,7 @@ using cli.Model; using Microsoft.Extensions.CommandLineUtils; using Microsoft.Extensions.Logging; using Microsoft.Extensions.OptionsModel; +using Yavsc; namespace cli { @@ -75,7 +76,7 @@ namespace cli { await _client.ConnectAsync( new Uri(_cxSettings.StreamingUrl+"/"+_flowIdArg.Value), _tokenSource.Token); - const int bufLen = 56*1024; + const int bufLen = Constants.WebSocketsMaxBufLen; byte [] buffer = new byte[bufLen]; const int offset=0; int read = 0; diff --git a/src/cli/project.json b/src/cli/project.json index bda98544..a3499dbf 100644 --- a/src/cli/project.json +++ b/src/cli/project.json @@ -48,7 +48,7 @@ "Newtonsoft.Json": "9.0.1", "NJsonSchema.CodeGeneration.CSharp": "9.10.65", "Yavsc": { - "version": "1.0.6-rc03", + "version": "1.0.6-rc04", "target": "package" }, "Microsoft.Dnx.Host": "1.0.0-rc1-final",