public static void InitBufferManagers() { if (ByteBuffer.TransportBufferManager == null) { lock (ByteBuffer.syncRoot) { if (ByteBuffer.TransportBufferManager == null) { ByteBuffer.TransportBufferManager = InternalBufferManager.Create((long)50331648, 65536, true); } } } }
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))); }
static ByteBuffer() { ByteBuffer.BufferManager = InternalBufferManager.Create((long)52428800, 2147483647, false); ByteBuffer.syncRoot = new object(); }
private ThrottledBufferManager(int maxSize) { this.bufferManager = InternalBufferManager.Create((long)maxSize, 2147483647, false); this.ProxyBufferManager = new ThrottledBufferManager.WrappedBufferManager(this); }