|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using MediaBrowser.Common.Events;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using MediaBrowser.Common.Events;
|
|
|
|
|
using MediaBrowser.Controller.Net;
|
|
|
|
|
using MediaBrowser.Model.Logging;
|
|
|
|
|
using MediaBrowser.Model.Net;
|
|
|
|
@ -122,23 +123,22 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
WebSocketMessageInfo info;
|
|
|
|
|
|
|
|
|
|
//_logger.Debug(Encoding.UTF8.GetString(bytes));
|
|
|
|
|
using (var memoryStream = new MemoryStream(bytes))
|
|
|
|
|
{
|
|
|
|
|
var stub = (WebSocketMessage<object>)_jsonSerializer.DeserializeFromStream(memoryStream, typeof(WebSocketMessage<object>));
|
|
|
|
|
|
|
|
|
|
info = new WebSocketMessageInfo
|
|
|
|
|
{
|
|
|
|
|
MessageType = stub.MessageType,
|
|
|
|
|
Data = stub.Data == null ? null : stub.Data.ToString()
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
var info = (WebSocketMessageInfo)_jsonSerializer.DeserializeFromStream(memoryStream, typeof(WebSocketMessageInfo));
|
|
|
|
|
|
|
|
|
|
//info = new WebSocketMessageInfo
|
|
|
|
|
//{
|
|
|
|
|
// MessageType = stub.MessageType,
|
|
|
|
|
// Data = stub.Data == null ? null : stub.Data.ToString()
|
|
|
|
|
//};
|
|
|
|
|
info.Connection = this;
|
|
|
|
|
|
|
|
|
|
OnReceive(info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.ErrorException("Error processing web socket message", ex);
|
|
|
|
|