Ejemplo n.º 1
0
        /// <summary>call back to call, when the async response has arrived.</summary>
        private void AsyncResponseArrived(IClientChannelSinkStack sinkStack, GiopClientConnection con,
                                          Stream responseStream, Exception resultException)
        {
            ITransportHeaders responseHeaders = new TransportHeaders();

            responseHeaders[GiopClientConnectionDesc.CLIENT_TR_HEADER_KEY] = con.Desc; // add to response headers

            // forward the response
            if ((resultException == null) && (responseStream != null))
            {
                #if DEBUG
                OutputHelper.LogStream(responseStream);
                #endif
                responseStream.Seek(0, SeekOrigin.Begin); // assure stream is read from beginning in formatter
                sinkStack.AsyncProcessResponse(responseHeaders, responseStream);
            }
            else
            {
                Exception toThrow = resultException;
                if (toThrow == null)
                {
                    toThrow = new omg.org.CORBA.INTERNAL(79, omg.org.CORBA.CompletionStatus.Completed_MayBe);
                }
                sinkStack.DispatchException(toThrow);
            }
        }
Ejemplo n.º 2
0
        /// <summary>call back to call, when the async response has arrived.</summary>
        private void AsyncResponseArrived(IClientChannelSinkStack sinkStack, GiopClientConnection con,
                                          Stream responseStream, Exception resultException) {
            ITransportHeaders responseHeaders = new TransportHeaders();
            responseHeaders[GiopClientConnectionDesc.CLIENT_TR_HEADER_KEY]= con.Desc; // add to response headers            

            // forward the response
            if ((resultException == null) && (responseStream != null)) {
                #if DEBUG
                OutputHelper.LogStream(responseStream);
                #endif                            
                responseStream.Seek(0, SeekOrigin.Begin); // assure stream is read from beginning in formatter
                sinkStack.AsyncProcessResponse(responseHeaders, responseStream);
            } else {
                Exception toThrow = resultException;
                if (toThrow == null) {
                    toThrow = new omg.org.CORBA.INTERNAL(79, omg.org.CORBA.CompletionStatus.Completed_MayBe);
                }
                sinkStack.DispatchException(toThrow);
            }                        
        }