Exemplo n.º 1
0
 public MtomBufferedMessageData(MtomMessageEncoder messageEncoder, int maxReaderPoolSize)
     : base(messageEncoder.RecycledStatePool)
 {
     this.messageEncoder = messageEncoder;
     readerPool          = new Pool <XmlDictionaryReader>(maxReaderPoolSize);
     onClose             = new OnXmlDictionaryReaderClose(OnXmlReaderClosed);
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
 public MtomMessageEncoderFactory(
     MtomMessageEncodingBindingElement owner)
 {
     this.owner = owner;
     encoder    = new MtomMessageEncoder(this);
 }
Exemplo n.º 8
0
 public MtomBufferedMessageWriter(MtomMessageEncoder messageEncoder)
 {
     this.messageEncoder = messageEncoder;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
            }
Exemplo n.º 13
0
 public MtomBufferedMessageWriter(MtomMessageEncoder messageEncoder)
 {
     this.messageEncoder = messageEncoder;
 }
Exemplo n.º 14
0
 public MtomBufferedMessageData(MtomMessageEncoder messageEncoder, int maxReaderPoolSize)
     : base(messageEncoder.RecycledStatePool)
 {
     this.messageEncoder = messageEncoder;
     readerPool = new Pool<XmlDictionaryReader>(maxReaderPoolSize);
     onClose = new OnXmlDictionaryReaderClose(OnXmlReaderClosed);
 }
Exemplo n.º 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);
 }
Exemplo n.º 16
0
		public MtomMessageEncoderFactory (
			MtomMessageEncodingBindingElement owner)
		{
			this.owner = owner;
			encoder = new MtomMessageEncoder (this);
		}