Exemplo n.º 1
0
 public static void InitBufferManagers()
 {
     if (ByteBuffer.TransportBufferManager == null)
     {
         lock (ByteBuffer.syncRoot)
         {
             if (ByteBuffer.TransportBufferManager == null)
             {
                 ByteBuffer.TransportBufferManager = InternalBufferManager.Create((long)50331648, 65536, true);
             }
         }
     }
 }
Exemplo n.º 2
0
        public static BufferManager CreateBufferManager(long maxBufferPoolSize, int maxBufferSize)
        {
            if (maxBufferPoolSize < 0)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(maxBufferPoolSize),
                                                                                                          maxBufferPoolSize, SR.ValueMustBeNonNegative));
            }

            if (maxBufferSize < 0)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(maxBufferSize),
                                                                                                          maxBufferSize, SR.ValueMustBeNonNegative));
            }

            return(new WrappingBufferManager(InternalBufferManager.Create(maxBufferPoolSize, maxBufferSize)));
        }
Exemplo n.º 3
0
 static ByteBuffer()
 {
     ByteBuffer.BufferManager = InternalBufferManager.Create((long)52428800, 2147483647, false);
     ByteBuffer.syncRoot      = new object();
 }
Exemplo n.º 4
0
 private ThrottledBufferManager(int maxSize)
 {
     this.bufferManager      = InternalBufferManager.Create((long)maxSize, 2147483647, false);
     this.ProxyBufferManager = new ThrottledBufferManager.WrappedBufferManager(this);
 }