当前位置: 首页>>代码示例>>C#>>正文


C# Protocol.TProtocol类代码示例

本文整理汇总了C#中Thrift.Protocol.TProtocol的典型用法代码示例。如果您正苦于以下问题:C# TProtocol类的具体用法?C# TProtocol怎么用?C# TProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TProtocol类属于Thrift.Protocol命名空间,在下文中一共展示了TProtocol类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Map) {
           {
             QuestTmpls = new Dictionary<int, QuestTemplate>();
             TMap _map0 = iprot.ReadMapBegin();
             for( int _i1 = 0; _i1 < _map0.Count; ++_i1)
             {
               int _key2;
               QuestTemplate _val3;
               _key2 = iprot.ReadI32();
               _val3 = new QuestTemplate();
               _val3.Read(iprot);
               QuestTmpls[_key2] = _val3;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Map) {
           {
             QuestChapterTmpls = new Dictionary<int, QuestChapterTemplate>();
             TMap _map4 = iprot.ReadMapBegin();
             for( int _i5 = 0; _i5 < _map4.Count; ++_i5)
             {
               int _key6;
               QuestChapterTemplate _val7;
               _key6 = iprot.ReadI32();
               _val7 = new QuestChapterTemplate();
               _val7.Read(iprot);
               QuestChapterTmpls[_key6] = _val7;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:wuxin0602,项目名称:Nothing,代码行数:60,代码来源:Quest.cs

示例2: Process

 public bool Process(TProtocol iprot, TProtocol oprot)
 {
     var received = iprot.ReadString();
     oprot.WriteString(received);
     oprot.Transport.Flush();
     return true;
 }
开发者ID:sky1737,项目名称:thriftclient,代码行数:7,代码来源:Run.cs

示例3: Read

 public void Read(TProtocol iprot)
 {
     TField field;
       iprot.ReadStructBegin();
       while (true)
       {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) {
       break;
     }
     switch (field.ID)
     {
       case 1:
     if (field.Type == TType.String) {
       Name = iprot.ReadBinary();
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 2:
     if (field.Type == TType.I64) {
       Value = iprot.ReadI64();
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       default:
     TProtocolUtil.Skip(iprot, field.Type);
     break;
     }
     iprot.ReadFieldEnd();
       }
       iprot.ReadStructEnd();
 }
开发者ID:HappiestTeam,项目名称:Spikes,代码行数:34,代码来源:CounterColumn.cs

示例4: Read

 public void Read (TProtocol iprot)
 {
   bool isset_msg = false;
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.String) {
           Msg = iprot.ReadString();
           isset_msg = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_msg)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }
开发者ID:bcardi,项目名称:storm-net-adapter,代码行数:31,代码来源:AlreadyAliveException.cs

示例5: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 10:
         if (field.Type == TType.I64) {
           UniqueId = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 20:
         if (field.Type == TType.Bool) {
           CanDisapper = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:sgyli7,项目名称:ClientFrameWork,代码行数:34,代码来源:MonsterDeath.cs

示例6: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.I32) {
           Pergunta = (PerguntaCriancasMenoresSeisMesesEnumThrift)iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.I32) {
           RespostaUnicaEscolha = (RespostaUnicaEscolhaEnumThrift)iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:bimhof,项目名称:integracao,代码行数:34,代码来源:PerguntaQuestionarioCriancasMenoresSeisMesesThrift.cs

示例7: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 10:
         if (field.Type == TType.I32) {
           HeroId = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 20:
         if (field.Type == TType.I32) {
           Favorability = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:sgyli7,项目名称:ClientFrameWork,代码行数:34,代码来源:HeroRecruitProgressInfo.cs

示例8: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Double) {
           Longitude = iprot.ReadDouble();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Double) {
           Latitude = iprot.ReadDouble();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:Banandana,项目名称:LineSharp,代码行数:34,代码来源:Geolocation.cs

示例9: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           ApplyFriendInfo = new KXSGCodec.FriendInfo();
           ApplyFriendInfo.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:wuxin0602,项目名称:Nothing,代码行数:28,代码来源:SCFriendQueryByName.cs

示例10: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 10:
         if (field.Type == TType.I32) {
           StateId = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 20:
         if (field.Type == TType.Bool) {
           IsConflict = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:Blizzardx,项目名称:ClientFrameWork,代码行数:34,代码来源:StateConflictConfigElement.cs

示例11: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 10:
         if (field.Type == TType.Struct) {
           FailSystemInfo = new NetFramework.Auto.SystemInfo();
           FailSystemInfo.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 20:
         if (field.Type == TType.Bool) {
           Decomp = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:sgyli7,项目名称:ClientFrameWork,代码行数:35,代码来源:SCRecruitHeroMsg.cs

示例12: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.I32) {
           Num_err_choice = (NumErrorsChoice)iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:bcardi,项目名称:storm-net-adapter,代码行数:27,代码来源:GetInfoOptions.cs

示例13: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.I16) {
           OperItemIndex = iprot.ReadI16();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:wuxin0602,项目名称:Nothing,代码行数:27,代码来源:CSEvoluteItem.cs

示例14: Write

 public void Write(TProtocol oprot)
 {
     TStruct struc = new TStruct("SchemaDisagreementException");
       oprot.WriteStructBegin(struc);
       oprot.WriteFieldStop();
       oprot.WriteStructEnd();
 }
开发者ID:HappiestTeam,项目名称:Spikes,代码行数:7,代码来源:SchemaDisagreementException.cs

示例15: Read

 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 10:
         if (field.Type == TType.I32) {
           EnhanceType = (NetFramework.Auto.HeroEquipmentEnhanceType)iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 20:
         if (field.Type == TType.I64) {
           EquipmentUniqueId = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
开发者ID:sgyli7,项目名称:ClientFrameWork,代码行数:34,代码来源:CSHeroEquipmentEnhanceMsg.cs


注:本文中的Thrift.Protocol.TProtocol类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。