progress on remote control

This commit is contained in:
Luke Pulverenti
2013-05-10 08:18:07 -04:00
parent 35a7986b3f
commit 44f33fdb55
16 changed files with 335 additions and 73 deletions

View File

@@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager
/// <summary>
/// The _send semaphore
/// </summary>
private readonly SemaphoreSlim _sendSemaphore = new SemaphoreSlim(1,1);
private readonly SemaphoreSlim _sendSemaphore = new SemaphoreSlim(1, 1);
/// <summary>
/// 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<object>)_jsonSerializer.DeserializeFromStream(memoryStream, typeof(WebSocketMessage<object>));
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.