public override void Close ()
		{
			if (closed) 
				return;
			
			headers = null;
			body = null;
			closed = true;
		}
		internal DefaultMessageBuffer (int maxBufferSize, MessageHeaders headers, MessageProperties properties, BodyWriter body, bool isFault)
		{
			this.max_buffer_size = maxBufferSize;
			this.headers = headers;
			this.body = body;
			this.closed = false;
			this.is_fault = isFault;
			this.properties = properties;
		}
 public HttpStreamMessage(MessageHeaders headers, MessageProperties properties, BodyWriter bodyWriter)
 {
     if (bodyWriter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bodyWriter");
     }
     this.headers = new MessageHeaders(headers);
     this.properties = new MessageProperties(properties);
     this.bodyWriter = bodyWriter;
 }
 public HttpStreamMessage(BodyWriter writer)
 {
     if (writer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");
     }
     this.bodyWriter = writer;
     this.headers = new MessageHeaders(MessageVersion.None, 1);
     this.properties = new MessageProperties();
 }
 public override void Close()
 {
     lock (ThisLock)
     {
         if (!closed)
         {
             closed = true;
             bodyWriter = null;
             headers = null;
             properties = null;
         }
     }
 }
        protected override void OnClose()
        {
            Exception ex = null;
            try
            {
                base.OnClose();
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                ex = e;
            }

            try
            {
                if (properties != null)
                {
                    properties.Dispose();
                }
            }
            catch (Exception e)
            {
                if (Fx.IsFatal(e))
                {
                    throw;
                }
                if (ex == null)
                {
                    ex = e;
                }
            }

            if (ex != null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(ex);
            }

            this.bodyWriter = null;
        }
 public HttpStreamMessageBuffer(MessageHeaders headers,
     MessageProperties properties, BodyWriter bodyWriter)
     : base()
 {
     this.bodyWriter = bodyWriter;
     this.headers = headers;
     this.properties = properties;
 }
Ejemplo n.º 8
0
 public BodyWriterMessageBuffer(MessageHeaders headers,
     KeyValuePair<string, object>[] properties, BodyWriter bodyWriter)
 {
     _bodyWriter = bodyWriter;
     _headers = new MessageHeaders(headers);
     _properties = properties;
 }
Ejemplo n.º 9
0
 public override void Close()
 {
     lock (ThisLock)
     {
         if (!_closed)
         {
             _closed = true;
             _bodyWriter = null;
             _headers = null;
             _properties = null;
         }
     }
 }
Ejemplo n.º 10
0
            public OnWriteBodyContentsAsyncResult(XmlDictionaryWriter writer, BodyWriter bodyWriter, AsyncCallback callback, object state)
                : base(callback, state)
            {
                Fx.Assert(bodyWriter != null, "bodyWriter should never be null");

                this.writer = writer;
                this.bodyWriter = bodyWriter;

                Schedule();
            }
Ejemplo n.º 11
0
 internal DefaultMessageBuffer(int maxBufferSize, MessageHeaders headers, MessageProperties properties, BodyWriter body, bool isFault, AttributeCollection attributes)
 {
     this.max_buffer_size = maxBufferSize;
     this.headers         = headers;
     this.body            = body;
     this.closed          = false;
     this.is_fault        = isFault;
     this.properties      = properties;
     this.attributes      = attributes;
 }
Ejemplo n.º 12
0
 public HttpStreamMessage(MessageHeaders headers, MessageProperties properties, BodyWriter bodyWriter)
 {
     if (bodyWriter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bodyWriter");
     }
     this.headers    = new MessageHeaders(headers);
     this.properties = new MessageProperties(properties);
     this.bodyWriter = bodyWriter;
 }
Ejemplo n.º 13
0
            protected override void OnClose()
            {
                Exception ex = null;

                try
                {
                    base.OnClose();
                }
                catch (Exception e)
                {
                    if (Fx.IsFatal(e))
                    {
                        throw;
                    }
                    ex = e;
                }

                try
                {
                    if (properties != null)
                    {
                        properties.Dispose();
                    }
                }
                catch (Exception e)
                {
                    if (Fx.IsFatal(e))
                    {
                        throw;
                    }
                    if (ex == null)
                    {
                        ex = e;
                    }
                }

                try
                {
                    if (reader != null)
                    {
                        reader.Close();
                    }
                }
                catch (Exception e)
                {
                    if (Fx.IsFatal(e))
                    {
                        throw;
                    }
                    if (ex == null)
                    {
                        ex = e;
                    }
                }

                if (ex != null)
                {
                    throw FxTrace.Exception.AsError(ex);
                }

                this.bodyWriter = null;
            }
Ejemplo n.º 14
0
		public SimpleMessage (MessageVersion version,
			string action, BodyWriter body, bool isFault)
			: base (version, action)
		{
			this.body = body;
			this.is_fault = isFault;
		}