Ejemplo n.º 1
0
        /// <summary>
        /// Sends the content to the specified remote host and redirects a response to the callback.
        /// </summary>
        /// <param name="destination">The remote host.</param>
        /// <param name="serviceName">The name of the service.</param>
        /// <param name="content">The content.</param>
        /// <param name="streamResponseEventHandler">The callback.</param>
        /// <param name="tag">The object that contains data about this invocation.</param>
        public void SendAsync(HostInformation destination, string serviceName, Stream content, StreamResponseEventHandler streamResponseEventHandler, object tag)
        {
            // create the message
            Message message = new Message(this.ITransportContext, destination, 0, new TransportHeaders(), content);

            message.IsSynchronous           = false;
            message.GenuineMessageType      = GenuineMessageType.ExternalStreamConsumer;
            message.DestinationMarshalByRef = serviceName;
            message.Tag = tag;

            // register the response catcher
            UniversalAsyncResponseProcessor universalAsyncResponseProcessor = new UniversalAsyncResponseProcessor(message, streamResponseEventHandler, null);

            this.ITransportContext.IIncomingStreamHandler.RegisterResponseProcessor(message.MessageId, universalAsyncResponseProcessor);

            // and send the message
            this.ITransportContext.ConnectionManager.Send(message);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sends the content to the specified remote host and redirects a response to the callback.
 /// </summary>
 /// <param name="destination">The remote host.</param>
 /// <param name="serviceName">The name of the service.</param>
 /// <param name="content">The content.</param>
 /// <param name="streamResponseEventHandler">The callback.</param>
 public void SendAsync(HostInformation destination, string serviceName, Stream content, StreamResponseEventHandler streamResponseEventHandler)
 {
     this.SendAsync(destination, serviceName, content, streamResponseEventHandler, null);
 }
        /// <summary>
        /// Sends the content to the specified remote host and redirects a response to the callback.
        /// </summary>
        /// <param name="destination">The remote host.</param>
        /// <param name="serviceName">The name of the service.</param>
        /// <param name="content">The content.</param>
        /// <param name="streamResponseEventHandler">The callback.</param>
        /// <param name="tag">The object that contains data about this invocation.</param>
        public void SendAsync(HostInformation destination, string serviceName, Stream content, StreamResponseEventHandler streamResponseEventHandler, object tag)
        {
            // create the message
            Message message = new Message(this.ITransportContext, destination, 0, new TransportHeaders(), content);
            message.IsSynchronous = false;
            message.GenuineMessageType = GenuineMessageType.ExternalStreamConsumer;
            message.DestinationMarshalByRef = serviceName;
            message.Tag = tag;

            // register the response catcher
            UniversalAsyncResponseProcessor universalAsyncResponseProcessor = new UniversalAsyncResponseProcessor(message, streamResponseEventHandler, null);
            this.ITransportContext.IIncomingStreamHandler.RegisterResponseProcessor(message.MessageId, universalAsyncResponseProcessor);

            // and send the message
            this.ITransportContext.ConnectionManager.Send(message);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes the instance of the UniversalAsyncResponseProcessor class.
 /// </summary>
 /// <param name="message">The source message.</param>
 /// <param name="streamResponseEventHandler">The response handler represented as a callback or a null reference.</param>
 /// <param name="iStreamResponseHandler">The response handler represented as a object supporting the IStreamResponseHandler interface or a null reference.</param>
 public UniversalAsyncResponseProcessor(Message message, StreamResponseEventHandler streamResponseEventHandler, IStreamResponseHandler iStreamResponseHandler)
 {
     this._message = message;
     this._streamResponseEventHandler = streamResponseEventHandler;
     this._iStreamResponseHandler     = iStreamResponseHandler;
 }
 /// <summary>
 /// Sends the content to the specified remote host and redirects a response to the callback.
 /// </summary>
 /// <param name="destination">The remote host.</param>
 /// <param name="serviceName">The name of the service.</param>
 /// <param name="content">The content.</param>
 /// <param name="streamResponseEventHandler">The callback.</param>
 public void SendAsync(HostInformation destination, string serviceName, Stream content, StreamResponseEventHandler streamResponseEventHandler)
 {
     this.SendAsync(destination, serviceName, content, streamResponseEventHandler, null);
 }