Пример #1
0
 public MtomBufferedMessageData(MtomMessageEncoder messageEncoder, int maxReaderPoolSize)
     : base(messageEncoder.RecycledStatePool)
 {
     this.messageEncoder = messageEncoder;
     readerPool          = new Pool <XmlDictionaryReader>(maxReaderPoolSize);
     onClose             = new OnXmlDictionaryReaderClose(OnXmlReaderClosed);
 }
Пример #2
0
            public WriteMessageAsyncResult(Message message, Stream stream, MtomMessageEncoder encoder, AsyncCallback callback, object state)
                : base(callback, state)
            {
                Fx.Assert(encoder != null, "encoder should never be null");

                this.encoder = encoder;
                this.message = message;
                this.stream  = stream;

                Schedule();
            }
        public IAsyncResult BeginWriteToStream(Stream stream, AsyncCallback callback, object state)
        {
            Fx.Assert(stream != null, "stream should not be null.");
            MtomMessageEncoder mtomMessageEncoder = this.messageEncoder as MtomMessageEncoder;

            if (mtomMessageEncoder == null)
            {
                return(this.messageEncoder.BeginWriteMessage(this.message, stream, callback, state));
            }
            else
            {
                return(mtomMessageEncoder.BeginWriteMessage(this.message, stream, this.mtomBoundary, callback, state));
            }
        }
        public void WriteToStream(Stream stream)
        {
            Fx.Assert(stream != null, "stream should not be null.");
            MtomMessageEncoder mtomMessageEncoder = this.messageEncoder as MtomMessageEncoder;

            if (mtomMessageEncoder == null)
            {
                this.messageEncoder.WriteMessage(this.message, stream);
            }
            else
            {
                mtomMessageEncoder.WriteMessage(this.message, stream, this.mtomBoundary);
            }
        }
Пример #5
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);
 }
Пример #6
0
        internal MtomMessageEncoder.MtomBufferedMessageWriter TakeBufferedWriter(MtomMessageEncoder messageEncoder)
        {
            if (_bufferedWriterPool == null)
            {
                lock (_thisLock)
                {
                    if (_bufferedWriterPool == null)
                    {
                        _bufferedWriterPool = new SynchronizedPool <MtomMessageEncoder.MtomBufferedMessageWriter>(MaxWritePoolSize);
                    }
                }
            }

            MtomMessageEncoder.MtomBufferedMessageWriter messageWriter = _bufferedWriterPool.Take();
            if (messageWriter == null)
            {
                messageWriter = new MtomMessageEncoder.MtomBufferedMessageWriter(messageEncoder);
                if (WcfEventSource.Instance.WritePoolMissIsEnabled())
                {
                    WcfEventSource.Instance.WritePoolMiss(messageWriter.GetType().Name);
                }
            }
            return(messageWriter);
        }
Пример #7
0
 public MtomMessageEncoderFactory(
     MtomMessageEncodingBindingElement owner)
 {
     this.owner = owner;
     encoder    = new MtomMessageEncoder(this);
 }
Пример #8
0
 public MtomBufferedMessageWriter(MtomMessageEncoder messageEncoder)
 {
     this.messageEncoder = messageEncoder;
 }
Пример #9
0
 public MtomMessageEncoderFactory(MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, int maxBufferSize, XmlDictionaryReaderQuotas quotas)
 {
     messageEncoder = new MtomMessageEncoder(version, writeEncoding, maxReadPoolSize, maxWritePoolSize, maxBufferSize, quotas);
 }
 public MtomMessageEncoderFactory(System.ServiceModel.Channels.MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, int maxBufferSize, XmlDictionaryReaderQuotas quotas)
 {
     this.messageEncoder = new MtomMessageEncoder(version, writeEncoding, maxReadPoolSize, maxWritePoolSize, maxBufferSize, quotas);
 }
 public MtomMessageEncoderFactory(System.ServiceModel.Channels.MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, int maxBufferSize, XmlDictionaryReaderQuotas quotas)
 {
     this.messageEncoder = new MtomMessageEncoder(version, writeEncoding, maxReadPoolSize, maxWritePoolSize, maxBufferSize, quotas);
 }
Пример #12
0
            public WriteMessageAsyncResult(Message message, Stream stream, string boundary, MtomMessageEncoder encoder, AsyncCallback callback, object state)
                : base(callback, state)
            {
                Fx.Assert(encoder != null, "encoder should never be null");

                this.encoder = encoder;
                this.message = message;
                this.stream = stream;
                this.boundary = boundary;

                this.writeBoundary = true;

                Schedule();
            }
Пример #13
0
 public MtomBufferedMessageWriter(MtomMessageEncoder messageEncoder)
 {
     this.messageEncoder = messageEncoder;
 }
Пример #14
0
 public MtomBufferedMessageData(MtomMessageEncoder messageEncoder, int maxReaderPoolSize)
     : base(messageEncoder.RecycledStatePool)
 {
     this.messageEncoder = messageEncoder;
     readerPool = new Pool<XmlDictionaryReader>(maxReaderPoolSize);
     onClose = new OnXmlDictionaryReaderClose(OnXmlReaderClosed);
 }
Пример #15
0
 public MtomMessageEncoderFactory(MessageVersion version, Encoding writeEncoding, int maxReadPoolSize, int maxWritePoolSize, int maxBufferSize, XmlDictionaryReaderQuotas quotas)
 {
     messageEncoder = new MtomMessageEncoder(version, writeEncoding, maxReadPoolSize, maxWritePoolSize, maxBufferSize, quotas);
 }
Пример #16
0
		public MtomMessageEncoderFactory (
			MtomMessageEncodingBindingElement owner)
		{
			this.owner = owner;
			encoder = new MtomMessageEncoder (this);
		}