Exemplo n.º 1
0
 internal MtomMessageEncoder.MtomBufferedMessageData TakeBufferedReader(MtomMessageEncoder messageEncoder)
 {
     if (_bufferedReaderPool == null)
     {
         lock (_thisLock)
         {
             if (_bufferedReaderPool == null)
             {
                 _bufferedReaderPool = new SynchronizedPool <MtomMessageEncoder.MtomBufferedMessageData>(MaxReadPoolSize);
             }
         }
     }
     MtomMessageEncoder.MtomBufferedMessageData messageData = _bufferedReaderPool.Take();
     if (messageData == null)
     {
         messageData = new MtomMessageEncoder.MtomBufferedMessageData(messageEncoder, MaxPooledXmlReadersPerMessage);
         if (WcfEventSource.Instance.ReadPoolMissIsEnabled())
         {
             WcfEventSource.Instance.ReadPoolMiss(messageData.GetType().Name);
         }
     }
     return(messageData);
 }
Exemplo n.º 2
0
 internal void ReturnBufferedData(MtomMessageEncoder.MtomBufferedMessageData messageData)
 {
     _bufferedReaderPool.Return(messageData);
 }