Microsoft.Azure.Amqp.InternalBufferManager.Create C# (CSharp) 메소드

Create() 공개 정적인 메소드

public static Create ( long maxBufferPoolSize, int maxBufferSize, bool isTransportBufferPool ) : InternalBufferManager
maxBufferPoolSize long
maxBufferSize int
isTransportBufferPool bool
리턴 InternalBufferManager
        public static InternalBufferManager Create(long maxBufferPoolSize, int maxBufferSize, bool isTransportBufferPool)
        {
            if (maxBufferPoolSize == 0)
            {
                return GCBufferManager.Value;
            }
            else
            {
                Fx.Assert(maxBufferPoolSize > 0 && maxBufferSize >= 0, "bad params, caller should verify");
                if (isTransportBufferPool)
                {
                    return new PreallocatedBufferManager(maxBufferPoolSize, maxBufferSize);
                }
                else
                {
                    return new PooledBufferManager(maxBufferPoolSize, maxBufferSize);
                }
            }
        }

Usage Example

예제 #1
0
 public static void InitBufferManagers()
 {
     if (TransportBufferManager == null)
     {
         lock (syncRoot)
         {
             if (TransportBufferManager == null)
             {
                 TransportBufferManager = InternalBufferManager.Create(48 * 1024 * 1024, AmqpConstants.TransportBufferSize, true);
             }
         }
     }
 }