public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
                                         IMessage msg, ITransportHeaders headers, Stream stream)

        {
            ITransportHeaders responseHeaders = new TransportHeaders();

            if (sinkStack != null)
            {
                stream = sinkStack.GetResponseStream(msg, responseHeaders);
            }
            if (stream == null)
            {
                stream = new MemoryStream();
            }

            SoapMessageFormatter soapMsgFormatter = (SoapMessageFormatter)state;

            SoapMessage soapMessage = (SoapMessage)soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage)msg, out responseHeaders);

            _soapCore.Serializer.Serialize(stream, soapMessage, null);

            if (stream is MemoryStream)
            {
                stream.Position = 0;
            }
            sinkStack.AsyncProcessResponse(msg, responseHeaders, stream);
        }
Beispiel #2
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack,
                                         object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            //Como no se suele ejecutar no he podido ver las cabeceras ni el mensaje
            if (!stream.CanWrite)
            {
                try
                {
                    AbrirStream(ref stream);
                }
                catch
                {
                    AbrirStream(ref stream,
                                System.Convert.ToInt32((string)msg.Properties["TamañoComprimido"]));
                }
            }
            ProcessResponse(msg, headers, ref stream, state);

            try
            {
                sinkStack.AsyncProcessResponse(msg, headers, stream);
            }
            catch (RemotingException e)
            {
                Console.Write(e.Message);
            }
        }
Beispiel #3
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, Object state, IMessage message, ITransportHeaders headers, Stream stream)
        {
            IPAddress ip = headers[CommonTransportKeys.IPAddress] as IPAddress;

            CallContext.SetData(CallContextSlotName, ip);
            sinkStack.AsyncProcessResponse(message, headers, stream);
        }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack,
                                         object state,
                                         IMessage msg,
                                         ITransportHeaders headers,
                                         Stream stream)
        {
            // fetching the flag from the async-state
            bool isEncrypted = (bool)state;


            if (isEncrypted)
            {
                // encrypting the response if necessary
                byte[] IV;

                stream = EncryptionHelper.ProcessOutboundStream(stream,
                                                                _encryptionAlgorithm, _encryptionKey, out IV);

                headers["X-Encrypt"]   = "yes";
                headers["X-EncryptIV"] = Convert.ToBase64String(IV);
            }


            // forwarding to the stack for further ProcessIng
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
Beispiel #5
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
                                         IMessage msg, ITransportHeaders headers, Stream stream)
        {
            // headers, stream are null, because formatting is first sink to create these two
            AsyncServerProcessingData asyncData = (AsyncServerProcessingData)state;

            try {
                IMessage requestMsg = asyncData.RequestMsg;
                SerialiseResponse(sinkStack, requestMsg, asyncData.ServerCon, msg,
                                  ref headers, out stream);
            }
            catch (Exception e) {
                if (asyncData.RequestMsg is IMethodCallMessage)
                {
                    msg = new ReturnMessage(e, (IMethodCallMessage)asyncData.RequestMsg);
                }
                else
                {
                    msg = new ReturnMessage(e, null); // no useful information present for requestMsg
                }
                // serialise the exception
                SerialiseExceptionResponse(sinkStack, (IMessage)state, asyncData.ServerCon, msg,
                                           ref headers, out stream);
            }
            sinkStack.AsyncProcessResponse(msg, headers, stream); // pass further on to the stream handling sinks
        }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage responseMsg, ITransportHeaders responseHeaders, Stream responseStream)
        {
            // parameters validation
            if (sinkStack == null)
            {
                throw new ArgumentNullException("sinkStack");
            }
            if (responseHeaders == null)
            {
                throw new ArgumentNullException("responseHeaders");
            }
            if (responseStream == null)
            {
                throw new ArgumentNullException("responseStream");
            }

            IMethodReturnMessage methodReturn = responseMsg as IMethodReturnMessage;

            if (methodReturn == null)
            {
                throw new NotSupportedException();
            }

            // serialize response
            _formatter.SerializeResponse(methodReturn, responseHeaders, responseStream);

            // process response asynchronously
            sinkStack.AsyncProcessResponse(responseMsg, responseHeaders, responseStream);
        }
        //---------------------- Implement IServerChannelSink -------------------//

        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, System.Runtime.Remoting.Messaging.IMessage msg, ITransportHeaders headers, System.IO.Stream stream)
        {
            IPAddress ip = headers[CommonTransportKeys.IPAddress] as IPAddress;

            CallContext.SetData("ClientIpAddress", ip);
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
        void IServerChannelSink.AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, System.IO.Stream stream)
        {
#if DEBUG
            System.Diagnostics.Trace.Assert((state as System.Threading.Thread).Equals(System.Threading.Thread.CurrentThread));
#endif
            sinkStack.AsyncProcessResponse(msg, headers, stream);
            ServerAuthenticationHelper.UnAuthenticate();
        }
Beispiel #9
0
        } // ProcessMessage

        /// <include file='doc\SoapFormatterSinks.uex' path='docs/doc[@for="SoapServerFormatterSink.AsyncProcessResponse"]/*' />
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, Object state,
                                         IMessage msg, ITransportHeaders headers, Stream stream)
        {
            // FUTURE: When async dispatching is enabled in V.Next, we will need to
            //   carry over bClientIsClr info.
            SerializeResponse(sinkStack, msg, true, ref headers, out stream);
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        } // AsyncProcessResponse
Beispiel #10
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, Object state,
                                         IMessage msg, ITransportHeaders headers, Stream stream)
        {
            // <

            SerializeResponse(sinkStack, msg, true, ref headers, out stream);
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        } // AsyncProcessResponse
Beispiel #11
0
        void IServerChannelSink.AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack,
                                                     object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            // process response
            ProcessResponse(msg, headers, ref stream, state);

            // forward to the next
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
Beispiel #12
0
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack
                                  , object state
                                  , IMessage msg
                                  , ITransportHeaders headers
                                  , System.IO.Stream stream)
 {
     SerializeResponseMessage(sinkStack, msg, ref headers, ref stream);
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
		/// <summary></summary>
		public void AsyncProcessResponse(
			IServerResponseChannelSinkStack sinkStack,
			Object state,
			IMessage message,
			ITransportHeaders headers,
			Stream stream)
		{
			SetClientIpAddressDataHelper(headers);
			sinkStack.AsyncProcessResponse(message, headers, stream);
		}
Beispiel #14
0
 public void AsyncProcessResponse(
     IServerResponseChannelSinkStack sinkStack,
     object state,
     IMessage msg,
     ITransportHeaders headers,
     Stream stream)
 {
     // Send the response to the client.
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
Beispiel #15
0
 /// <summary></summary>
 public void AsyncProcessResponse(
     IServerResponseChannelSinkStack sinkStack,
     Object state,
     IMessage message,
     ITransportHeaders headers,
     Stream stream)
 {
     SetClientIpAddressDataHelper(headers);
     sinkStack.AsyncProcessResponse(message, headers, stream);
 }
 public void AsyncProcessResponse(
     IServerResponseChannelSinkStack sinkStack,
     object state,
     IMessage msg,
     ITransportHeaders headers,
     Stream stream)
 {
     // Send the response to the client.
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
 public void AsyncProcessResponse(
         IServerResponseChannelSinkStack sinkStack,
         Object state,
         IMessage message,
         ITransportHeaders headers,
         Stream stream)
 {
     IPAddress ip = headers[CommonTransportKeys.IPAddress] as IPAddress;
         CallContext.SetData("ClientIPAddress", ip);
         sinkStack.AsyncProcessResponse(message, headers, stream);
 }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            ClientState cs = state as ClientState;
            if (cs != null && cs.clientCompressed) {
                // compress the shits
                stream = CompressionHelper.CompressStream(stream);
                headers[CompressionHelper.CompressKey] = CompressionHelper.CompressedFlag;
            }

            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack,
                                         object state,
                                         IMessage msg,
                                         ITransportHeaders headers,
                                         Stream stream)
        {
            // compressing the response
            stream = CompressionHelper.getCompressedStreamCopy(stream);

            // forwarding to the stack for further processing
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
Beispiel #20
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            ClientState cs = state as ClientState;

            if (cs != null && cs.clientCompressed)
            {
                // compress the shits
                stream = CompressionHelper.CompressStream(stream);
                headers[CompressionHelper.CompressKey] = CompressionHelper.CompressedFlag;
            }

            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
		public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
						  IMessage message, ITransportHeaders headers, Stream stream)
		{
			ITransportHeaders responseHeaders = new TransportHeaders();

			if (sinkStack != null) stream = sinkStack.GetResponseStream (message, responseHeaders);
			if (stream == null) stream = new MemoryStream();

			_binaryCore.Serializer.Serialize (stream, message, null);
			if (stream is MemoryStream) stream.Position = 0;

			sinkStack.AsyncProcessResponse (message, responseHeaders, stream);
		}
Beispiel #22
0
        public void AsyncProcessResponse(
            IServerResponseChannelSinkStack sinkStack_in,
            object state_in,
            IMessage message_in,
            ITransportHeaders headers_in,
            Stream stream_in
            )
        {
#if DEBUG
            Console.WriteLine("encryption sink: AsyncProcessResponse");
#endif

            bool _hasBeenEncrypted
                = (state_in != null)
                                        ? ((StateStruct)state_in).isEncripted
                                        : false
                ;

            if (_hasBeenEncrypted)
            {
                #region encrypt...
                headers_in[EncryptionHelper.X_ENCRYPT] = "1";
                stream_in
                    = EncryptionHelper.Encrypt(
                          stream_in,
                          true,
                          this.keyspath_,
                          ((StateStruct)state_in).ClientID
                          );
                #endregion
            }
            else
            {
                if (this.mustdo_)
                {
                    throw new Exception("\n\n\t\tyour activity is being logged!\n\n\t\tun-encrypted communications not allowed!\n\n");
                }
            }

            sinkStack_in.AsyncProcessResponse(
                message_in,
                headers_in,
                stream_in
                );
        }
		public void AsyncProcessResponse(
			IServerResponseChannelSinkStack sinkStack_in,
			object state_in,
			IMessage message_in,
			ITransportHeaders headers_in,
			Stream stream_in
		) {
			CallContext.SetData(
				"ClientIPAddress", 
				((IPAddress)headers_in[CommonTransportKeys.IPAddress]).ToString()
			);

			sinkStack_in.AsyncProcessResponse(
				message_in, 
				headers_in, 
				stream_in
			);
		}
Beispiel #24
0
        public void AsyncProcessResponse(
            IServerResponseChannelSinkStack sinkStack_in,
            object state_in,
            IMessage message_in,
            ITransportHeaders headers_in,
            Stream stream_in
            )
        {
            CallContext.SetData(
                "ClientIPAddress",
                ((IPAddress)headers_in[CommonTransportKeys.IPAddress]).ToString()
                );

            sinkStack_in.AsyncProcessResponse(
                message_in,
                headers_in,
                stream_in
                );
        }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage message, ITransportHeaders headers, Stream stream)
        {
            ITransportHeaders transportHeader = new TransportHeaders();

            if (sinkStack != null)
            {
                stream = sinkStack.GetResponseStream(message, transportHeader);
            }
            if (stream == null)
            {
                stream = new MemoryStream();
            }
            this._binaryCore.Serializer.Serialize(stream, message, null);
            if (stream is MemoryStream)
            {
                stream.Position = (long)0;
            }
            sinkStack.AsyncProcessResponse(message, transportHeader, stream);
        }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack,
                                         object state,
                                         IMessage msg,
                                         ITransportHeaders headers,
                                         Stream stream)
        {
            // fetching the flag from the async-state
            bool hasBeenCompressed = (bool)state;

            // compressing the response if necessary
            if (hasBeenCompressed)
            {
                stream = CompressionHelper.GetCompressedStreamCopy(stream);
                headers["X-Compress"] = "yes";
            }


            // forwarding to the stack for further processing
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
Beispiel #27
0
 /// <summary>
 /// Asyncs the process response.
 /// </summary>
 /// <param name="sinkStack">The sink stack.</param>
 /// <param name="state">The state.</param>
 /// <param name="message">The message.</param>
 /// <param name="headers">The headers.</param>
 /// <param name="stream">The stream.</param>
 public void AsyncProcessResponse(
     IServerResponseChannelSinkStack sinkStack,
     object state,
     IMessage message,
     ITransportHeaders headers,
     System.IO.Stream stream)
 {
     // get the client's ip address, and put it in the call context. This value will be
     // extracted later so we can determine the actual address of the client.
     try
     {
         IPAddress ipAddr = (IPAddress)headers[CommonTransportKeys.IPAddress];
         CallContext.SetData("ClientIP", ipAddr);
     }
     catch (Exception)
     {
         //do nothing
     }
     //forward to stack for further processing
     sinkStack.AsyncProcessResponse(message, headers, stream);
 }
Beispiel #28
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
                                         IMessage msg, ITransportHeaders headers, Stream stream)
        {
            ITransportHeaders responseHeaders = new TransportHeaders();

            if (sinkStack != null)
            {
                stream = sinkStack.GetResponseStream(msg, responseHeaders);
            }
            if (stream == null)
            {
                stream = new MemoryStream();
            }

            _binaryCore.Serializer.Serialize(stream, msg, null);
            if (stream is MemoryStream)
            {
                stream.Position = 0;
            }

            sinkStack.AsyncProcessResponse(msg, responseHeaders, stream);
        }
Beispiel #29
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            try
            {
                IPAddress IPAddr = (IPAddress)headers[CommonTransportKeys.IPAddress];
                //====================================
                //Console.WriteLine(IPAddr.ToString());
                //====================================
                CallContext.SetData("ClientIP", IPAddr);
                //IPHostEntry hostInfo = Dns.Resolve("");
                //string _hs = headers[CommonTransportKeys.RequestUri].ToString() ;
                //CallContext.SetData("ClientHost",_hs);
            }
            catch (Exception ex)
            {
                string errmsg = ex.Message;
            }


            //if (CompressSinkHelper.IsClientSupportCompress(headers))
            stream = CompressSinkHelper.CompressStream(headers, stream);
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
Beispiel #30
0
        public void AsyncProcessResponse(
            IServerResponseChannelSinkStack sinkStack_in,
            object state_in,
            IMessage message_in,
            ITransportHeaders headers_in,
            Stream stream_in
            )
        {
#if DEBUG
            Console.WriteLine("compression sink: AsyncProcessResponse...");
#endif
            bool _hasBeenCompressed = (bool)state_in;

            if (_hasBeenCompressed)
            {
                #region compress...
                headers_in[CompressionHelper.X_COMPRESS] = "1";

                stream_in = CompressionHelper.GetCompressedStreamCopy(
                    stream_in
                    );
                #endregion
            }
            else
            {
                if (this.mustdo_)
                {
                    throw new Exception("\n\n\t\tyour activity is being logged!\n\n\t\tun-compressed communications not allowed!\n\n");
                }
            }

            sinkStack_in.AsyncProcessResponse(
                message_in,
                headers_in,
                stream_in
                );
        }
Beispiel #31
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, 
            object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            //Como no se suele ejecutar no he podido ver las cabeceras ni el mensaje
            if (!stream.CanWrite)
            {
                try
                {
                    AbrirStream(ref stream);
                }
                catch
                {
                    AbrirStream(ref stream,
                        System.Convert.ToInt32( (string)msg.Properties["TamañoComprimido"]) );
                }
            }
            ProcessResponse(msg, headers, ref stream, state);

            try
            {
                sinkStack.AsyncProcessResponse(msg, headers, stream);
            }
            catch (RemotingException e)
            {
                Console.Write(e.Message);
            }
        }
		public void AsyncProcessResponse(
			IServerResponseChannelSinkStack sinkStack_in, 
			object state_in,
			IMessage message_in, 
			ITransportHeaders headers_in, 
			Stream stream_in
		) {
#if DEBUG
			Console.WriteLine("encryption sink: AsyncProcessResponse");
#endif

			bool _hasBeenEncrypted 
				= (state_in != null) 
					? ((StateStruct)state_in).isEncripted
					: false
				;

			if (_hasBeenEncrypted) {
				#region encrypt...
				headers_in[EncryptionHelper.X_ENCRYPT] = "1";
				stream_in
					= EncryptionHelper.Encrypt(
						stream_in,
						true,
						keyspath_,
						((StateStruct)state_in).ClientID
					); 
				#endregion
			} else {
				if (mustdo_) {
					throw new Exception("\n\n\t\tyour activity is being logged!\n\n\t\tun-encrypted communications not allowed!\n\n");
				}
			}

			sinkStack_in.AsyncProcessResponse(
				message_in,
				headers_in, 
				stream_in
			);
		} 
		public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,
						  IMessage msg, ITransportHeaders headers, Stream stream)
						  
		{
			ITransportHeaders responseHeaders = new TransportHeaders();

			if(sinkStack != null) stream = sinkStack.GetResponseStream(msg, responseHeaders);
			if(stream == null) stream = new MemoryStream();

			SoapMessageFormatter soapMsgFormatter = (SoapMessageFormatter)state;

			SoapMessage soapMessage = (SoapMessage) soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage)msg, out responseHeaders);

			_soapCore.Serializer.Serialize(stream, soapMessage, null);

			if(stream is MemoryStream) stream.Position = 0;
			sinkStack.AsyncProcessResponse (msg, responseHeaders, stream);
		}
Beispiel #34
0
 /// <summary>
 /// Fordert die Verarbeitung der Antwortnachricht von dieser Senke an, wenn die Anfragenachricht asynchron verarbeitet wurde.
 /// </summary>
 /// <param name="sinkStack">Senkenstapel</param>
 /// <param name="state">Zustand</param>
 /// <param name="msg">antwort-Nachricht</param>
 /// <param name="headers">Antwort-Header</param>
 /// <param name="stream">Antwort-Datenstrom</param>
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
 {
     // Antwortnachtenverarbeitung der verbleibenden Senken im Stapel aufrufen
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
Beispiel #35
0
        void IServerChannelSink.AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack,
            object state, IMessage msg, ITransportHeaders headers, Stream stream)
        {
            // process response
            ProcessResponse(msg, headers, ref stream, state);

            // forward to the next
            sinkStack.AsyncProcessResponse(msg, headers, stream);
        }
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, Object state,
                                  IMessage msg, ITransportHeaders headers, Stream stream)
 {
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, 
     IMessage msg, ITransportHeaders headers, Stream stream)
 {
     // перенаправляем вызов следующему приемнику в цепи
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
Beispiel #38
0
 /// <summary>
 /// Fordert die Verarbeitung der Antwortnachricht von dieser Senke an, wenn die Anfragenachricht asynchron verarbeitet wurde.
 /// </summary>
 /// <param name="sinkStack">Senkenstapel</param>
 /// <param name="state">Zustand</param>
 /// <param name="msg">antwort-Nachricht</param>
 /// <param name="headers">Antwort-Header</param>
 /// <param name="stream">Antwort-Datenstrom</param>
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
 {
     // Antwortnachtenverarbeitung der verbleibenden Senken im Stapel aufrufen
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
Beispiel #39
0
 void IServerChannelSink.AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, System.IO.Stream stream)
 {
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
Beispiel #40
0
		public void AsyncProcessResponse(
			IServerResponseChannelSinkStack sinkStack_in, 
			object state_in,
			IMessage message_in, 
			ITransportHeaders headers_in, 
			Stream stream_in
		) {
#if DEBUG
			Console.WriteLine("compression sink: AsyncProcessResponse...");
#endif
			bool _hasBeenCompressed = (bool)state_in;

			if (_hasBeenCompressed) {
				#region compress...
				headers_in[CompressionHelper.X_COMPRESS] = "1";

				stream_in = CompressionHelper.GetCompressedStreamCopy(
					stream_in
				); 
				#endregion
			} else {
				if (this.mustdo_) {
					throw new Exception("\n\n\t\tyour activity is being logged!\n\n\t\tun-compressed communications not allowed!\n\n");
				}
			}

			sinkStack_in.AsyncProcessResponse(
				message_in,
				headers_in, 
				stream_in
			);
		} 
 void IServerChannelSink.AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream)
 {
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
 //---------------------- Implement IServerChannelSink -------------------//
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, System.Runtime.Remoting.Messaging.IMessage msg, ITransportHeaders headers, System.IO.Stream stream)
 {
     IPAddress ip = headers[CommonTransportKeys.IPAddress] as IPAddress;
     CallContext.SetData("ClientIpAddress", ip);
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
Beispiel #43
0
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage message, ITransportHeaders headers, Stream stream)
        {
            object obj1 = headers["__IPAddress"];

            sinkStack.AsyncProcessResponse(message, headers, stream);
        }
Beispiel #44
0
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage message, ITransportHeaders headers, Stream stream)
 {
     object obj1 = headers["__IPAddress"];
     sinkStack.AsyncProcessResponse(message, headers, stream);
 }
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
                                  IMessage msg, ITransportHeaders headers, Stream stream)
 {
     // перенаправляем вызов следующему приемнику в цепи
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 }
        public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage responseMsg, ITransportHeaders responseHeaders, Stream responseStream)
        {
            // parameters validation
            if (sinkStack == null)
                throw new ArgumentNullException("sinkStack");
            if (responseHeaders == null)
                throw new ArgumentNullException("responseHeaders");
            if (responseStream == null)
                throw new ArgumentNullException("responseStream");

            var methodReturn = responseMsg as IMethodReturnMessage;
            if (methodReturn == null)
                throw new NotSupportedException();

            // serialize response
            _formatter.SerializeResponse(methodReturn, responseHeaders, responseStream);

            // process response asynchronously
            sinkStack.AsyncProcessResponse(responseMsg, responseHeaders, responseStream);
        }
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state,
                                  IMessage msg, ITransportHeaders headers, Stream stream) {
     // headers, stream are null, because formatting is first sink to create these two
     AsyncServerProcessingData asyncData = (AsyncServerProcessingData) state;
     try {
         IMessage requestMsg = asyncData.RequestMsg;
         SerialiseResponse(sinkStack, requestMsg, asyncData.ServerCon, msg,
                           ref headers, out stream);
     }
     catch (Exception e) {
         if (asyncData.RequestMsg is IMethodCallMessage) {
             msg = new ReturnMessage(e, (IMethodCallMessage) asyncData.RequestMsg);
         } else {
             msg = new ReturnMessage(e, null); // no useful information present for requestMsg
         }
         // serialise the exception
         SerialiseExceptionResponse(sinkStack, (IMessage)state, asyncData.ServerCon, msg,
                                    ref headers, out stream);
     }
     sinkStack.AsyncProcessResponse(msg, headers, stream); // pass further on to the stream handling sinks
 }
Beispiel #48
0
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage message, ITransportHeaders headers, Stream stream)
 {
     stream = Zip.Compress(stream);
     sinkStack.AsyncProcessResponse(message, headers, stream);
 }
 public void AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, Object state,
                                  IMessage msg, ITransportHeaders headers, Stream stream)
 {
     SerializeResponse(sinkStack, msg, ref headers, out stream);
     sinkStack.AsyncProcessResponse(msg, headers, stream);
 } // AsyncProcessResponse
 void IServerChannelSink.AsyncProcessResponse(IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, System.IO.Stream stream)
 {
     #if DEBUG
     System.Diagnostics.Trace.Assert((state as System.Threading.Thread).Equals(System.Threading.Thread.CurrentThread));
     #endif
     sinkStack.AsyncProcessResponse(msg, headers, stream);
     ServerAuthenticationHelper.UnAuthenticate();
 }