up
This commit is contained in:
24
Assets/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs
Normal file
24
Assets/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
#if !BESTHTTP_DISABLE_SIGNALR
|
||||
|
||||
using BestHTTP.JSON;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BestHTTP.SignalR.JsonEncoders
|
||||
{
|
||||
public sealed class DefaultJsonEncoder : IJsonEncoder
|
||||
{
|
||||
public string Encode(object obj)
|
||||
{
|
||||
return Json.Encode(obj);
|
||||
}
|
||||
|
||||
public IDictionary<string, object> DecodeMessage(string json)
|
||||
{
|
||||
bool ok = false;
|
||||
IDictionary<string, object> result = Json.Decode(json, ref ok) as IDictionary<string, object>;
|
||||
return ok ? result : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user