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)); }
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()); }