@@ -787,12 +787,13 @@ public void NotifyReceivedCloseOk()
787
787
TerminateMainloop ( ) ;
788
788
m_closed = true ;
789
789
}
790
-
790
+
791
791
///<summary>
792
792
/// Sets the channel named in the SoftProtocolException into
793
793
/// "quiescing mode", where we issue a channel.close and
794
- /// ignore everything up to the channel.close-ok reply that
795
- /// should eventually arrive.
794
+ /// ignore everything except for subsequent channel.close
795
+ /// messages and the channel.close-ok reply that should
796
+ /// eventually arrive.
796
797
///</summary>
797
798
///<remarks>
798
799
///<para>
@@ -817,23 +818,12 @@ public void NotifyReceivedCloseOk()
817
818
///</para>
818
819
///</remarks>
819
820
public void QuiesceChannel ( SoftProtocolException pe ) {
820
- // First, construct the close request and QuiescingSession
821
- // that we'll use during the quiesce process.
822
-
823
- Command request ;
824
- int replyClassId ;
825
- int replyMethodId ;
826
- Protocol . CreateChannelClose ( pe . ReplyCode ,
827
- pe . Message ,
828
- out request ,
829
- out replyClassId ,
830
- out replyMethodId ) ;
821
+ // Construct the QuiescingSession that we'll use during
822
+ // the quiesce process.
831
823
832
824
ISession newSession = new QuiescingSession ( this ,
833
825
pe . Channel ,
834
- pe . ShutdownReason ,
835
- replyClassId ,
836
- replyMethodId ) ;
826
+ pe . ShutdownReason ) ;
837
827
838
828
// Here we detach the session from the connection. It's
839
829
// still alive: it just won't receive any further frames
@@ -852,7 +842,7 @@ public void QuiesceChannel(SoftProtocolException pe) {
852
842
// our peer. The peer will respond through the lower
853
843
// layers - specifically, through the QuiescingSession we
854
844
// installed above.
855
- newSession . Transmit ( request ) ;
845
+ newSession . Transmit ( ChannelCloseWrapper ( pe . ReplyCode , pe . Message ) ) ;
856
846
}
857
847
858
848
public void HandleMainLoopException ( ShutdownEventArgs reason ) {
@@ -960,7 +950,19 @@ public Command ConnectionCloseWrapper(ushort reasonCode, string reasonText)
960
950
out replyClassId ,
961
951
out replyMethodId ) ;
962
952
return request ;
963
- }
953
+ }
954
+
955
+ protected Command ChannelCloseWrapper ( ushort reasonCode , string reasonText )
956
+ {
957
+ Command request ;
958
+ int replyClassId , replyMethodId ;
959
+ Protocol . CreateChannelClose ( reasonCode ,
960
+ reasonText ,
961
+ out request ,
962
+ out replyClassId ,
963
+ out replyMethodId ) ;
964
+ return request ;
965
+ }
964
966
965
967
private static uint NegotiatedMaxValue ( uint clientValue , uint serverValue )
966
968
{
0 commit comments