From 44f33fdb555aa9be3d710f7e81b995730ae836be Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 10 May 2013 08:18:07 -0400 Subject: progress on remote control --- .../ServerManager/WebSocketConnection.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs') diff --git a/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs b/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs index 5a074d194..6b6826bdc 100644 --- a/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs +++ b/MediaBrowser.Server.Implementations/ServerManager/WebSocketConnection.cs @@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager /// /// The _send semaphore /// - private readonly SemaphoreSlim _sendSemaphore = new SemaphoreSlim(1,1); + private readonly SemaphoreSlim _sendSemaphore = new SemaphoreSlim(1, 1); /// /// The logger @@ -100,7 +100,13 @@ namespace MediaBrowser.Server.Implementations.ServerManager using (var memoryStream = new MemoryStream(bytes)) { - info = (WebSocketMessageInfo)_jsonSerializer.DeserializeFromStream(memoryStream, typeof(WebSocketMessageInfo)); + var stub = (WebSocketMessage)_jsonSerializer.DeserializeFromStream(memoryStream, typeof(WebSocketMessage)); + + info = new WebSocketMessageInfo + { + MessageType = stub.MessageType, + Data = stub.Data == null ? null : stub.Data.ToString() + }; } info.Connection = this; @@ -163,7 +169,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager { throw new ArgumentNullException("cancellationToken"); } - + cancellationToken.ThrowIfCancellationRequested(); // Per msdn docs, attempting to send simultaneous messages will result in one failing. -- cgit v1.2.3