Remove dead code and improve logging

This commit is contained in:
Bond-009
2019-12-27 15:20:27 +01:00
committed by Bond_009
parent 4d311870d2
commit 8865b3ea3d
7 changed files with 18 additions and 175 deletions

View File

@@ -77,8 +77,6 @@ namespace MediaBrowser.Controller.Net
return Task.CompletedTask;
}
protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
/// <summary>
/// Starts sending messages over a web socket
/// </summary>
@@ -87,12 +85,12 @@ namespace MediaBrowser.Controller.Net
{
var vals = message.Data.Split(',');
var dueTimeMs = long.Parse(vals[0], UsCulture);
var periodMs = long.Parse(vals[1], UsCulture);
var dueTimeMs = long.Parse(vals[0], CultureInfo.InvariantCulture);
var periodMs = long.Parse(vals[1], CultureInfo.InvariantCulture);
var cancellationTokenSource = new CancellationTokenSource();
Logger.LogDebug("{1} Begin transmitting over websocket to {0}", message.Connection.RemoteEndPoint, GetType().Name);
Logger.LogDebug("WS {1} begin transmitting to {0}", message.Connection.RemoteEndPoint, GetType().Name);
var state = new TStateType
{
@@ -196,7 +194,7 @@ namespace MediaBrowser.Controller.Net
/// <param name="connection">The connection.</param>
private void DisposeConnection(Tuple<IWebSocketConnection, CancellationTokenSource, TStateType> connection)
{
Logger.LogDebug("{1} stop transmitting over websocket to {0}", connection.Item1.RemoteEndPoint, GetType().Name);
Logger.LogDebug("WS {1} stop transmitting to {0}", connection.Item1.RemoteEndPoint, GetType().Name);
// TODO disposing the connection seems to break websockets in subtle ways, so what is the purpose of this function really...
// connection.Item1.Dispose();
@@ -241,6 +239,7 @@ namespace MediaBrowser.Controller.Net
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}