Exemplo n.º 1
0
        private void CheckFPCallback(CallbackData cbd)
        {
            bool   isAnswerException = false;
            FPData data = cbd.GetData();
            IDictionary <string, object> payload = null;

            if (data != null)
            {
                if (data.GetFlag() == 0)
                {
                    payload = Json.Deserialize <IDictionary <string, object> >(data.JsonPayload());
                }

                if (data.GetFlag() == 1)
                {
                    MemoryStream inputStream = new MemoryStream(data.MsgpackPayload());
                    payload = MsgPack.Deserialize <IDictionary <string, object> >(inputStream);
                }

                if (this._baseClient.GetPackage().IsAnswer(data))
                {
                    isAnswerException = data.GetSS() != 0;
                }
            }

            cbd.CheckException(isAnswerException, payload);
        }