using Thrift; using Thrift.Protocol; ... TProtocol protocol = new TBinaryProtocol(new TMemoryBuffer()); // Increment the recursion depth before encoding a nested message protocol.IncrementRecursionDepth(); // Encode the nested message protocol.WriteListBegin(new TList(TType.Map, 2)); // Decrement the recursion depth after encoding the nested message protocol.DecrementRecursionDepth();This code demonstrates how to increment and decrement the recursion depth of the protocol using the IncrementRecursionDepth and DecrementRecursionDepth methods. The Thrift.Protocol.TProtocol class is part of the Thrift library, which is available as a NuGet package for C#.