private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder)
        {
            if (this.bufferedDataPool == null)
            {
                lock (this.ThisLock)
                {
                    if (this.bufferedDataPool == null)
                    {
                        this.bufferedDataPool = new SynchronizedPool <BinaryBufferedMessageData>(this.maxReadPoolSize);
                    }
                }
            }
            BinaryBufferedMessageData data = this.bufferedDataPool.Take();

            if (data == null)
            {
                data = new BinaryBufferedMessageData(this, 2);
            }
            data.SetMessageEncoder(messageEncoder);
            return(data);
        }
 private void ReturnBufferedData(BinaryBufferedMessageData messageData)
 {
     messageData.SetMessageEncoder(null);
     this.bufferedDataPool.Return(messageData);
 }
Beispiel #3
0
 private void ReturnBufferedData(BinaryBufferedMessageData messageData)
 {
     messageData.SetMessageEncoder(null);
     _bufferedDataPool.Return(messageData);
 }
Beispiel #4
0
 private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder)
 {
     if (_bufferedDataPool == null)
     {
         lock (ThisLock)
         {
             if (_bufferedDataPool == null)
             {
                 //running = true;
                 _bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(_maxReadPoolSize);
             }
         }
     }
     BinaryBufferedMessageData messageData = _bufferedDataPool.Take();
     if (messageData == null)
     {
         messageData = new BinaryBufferedMessageData(this, maxPooledXmlReaderPerMessage);
         if (WcfEventSource.Instance.ReadPoolMissIsEnabled())
         {
             WcfEventSource.Instance.ReadPoolMiss(messageData.GetType().Name);
         }
     }
     messageData.SetMessageEncoder(messageEncoder);
     return messageData;
 }
 BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder)
 {
     if (bufferedDataPool == null)
     {
         lock (ThisLock)
         {
             if (bufferedDataPool == null)
             {
                 //running = true;
                 bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(maxReadPoolSize);
             }
         }
     }
     BinaryBufferedMessageData messageData = bufferedDataPool.Take();
     if (messageData == null)
     {
         messageData = new BinaryBufferedMessageData(this, maxPooledXmlReaderPerMessage);
         if (TD.ReadPoolMissIsEnabled())
         {
             TD.ReadPoolMiss(messageData.GetType().Name);
         }
     }
     messageData.SetMessageEncoder(messageEncoder);
     return messageData;
 }
 private BinaryBufferedMessageData TakeBufferedData(BinaryMessageEncoder messageEncoder)
 {
     if (this.bufferedDataPool == null)
     {
         lock (this.ThisLock)
         {
             if (this.bufferedDataPool == null)
             {
                 this.bufferedDataPool = new SynchronizedPool<BinaryBufferedMessageData>(this.maxReadPoolSize);
             }
         }
     }
     BinaryBufferedMessageData data = this.bufferedDataPool.Take();
     if (data == null)
     {
         data = new BinaryBufferedMessageData(this, 2);
     }
     data.SetMessageEncoder(messageEncoder);
     return data;
 }