Exemplo n.º 1
0
            private bool HandleCloseInputSession(IAsyncResult result, bool isStillSynchronous)
            {
                Message message = this.channel.messageSource.EndReceive(result);

                if (message != null)
                {
                    using (message)
                    {
                        Type              type              = typeof(ProtocolException);
                        object[]          objArray          = new object[] { message };
                        ProtocolException protocolException = (ProtocolException)InvokeHelper.InvokeStaticMethod(type, "ReceiveShutdownReturnedNonNull", objArray);
                        throw TraceUtility.ThrowHelperError(protocolException, message);
                    }
                }
                this.channel.OnInputSessionClosed();
                return(this.ScheduleCompleteClose(isStillSynchronous));
            }
Exemplo n.º 2
0
        protected override void OnClose(TimeSpan timeout)
        {
            TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);

            this.CloseOutputSession(timeoutHelper.RemainingTime());
            if (!this.isInputSessionClosed)
            {
                Message message = this.messageSource.Receive(timeoutHelper.RemainingTime());
                if (message != null)
                {
                    using (message)
                    {
                        Type              type              = typeof(ProtocolException);
                        object[]          objArray          = new object[] { message };
                        ProtocolException protocolException = (ProtocolException)InvokeHelper.InvokeStaticMethod(type, "ReceiveShutdownReturnedNonNull", objArray);
                        throw TraceUtility.ThrowHelperError(protocolException, message);
                    }
                }
                this.OnInputSessionClosed();
            }
            this.CompleteClose(timeoutHelper.RemainingTime());
        }