@@ -53,6 +53,8 @@ namespace RabbitMQ.Client.Framing.Impl
53
53
public class AutorecoveringConnection : IConnection , IRecoverable
54
54
{
55
55
public readonly object m_eventLock = new object ( ) ;
56
+
57
+ public readonly object manuallyClosedLock = new object ( ) ;
56
58
protected Connection m_delegate ;
57
59
protected ConnectionFactory m_factory ;
58
60
@@ -104,6 +106,23 @@ public AutorecoveringConnection(ConnectionFactory factory, string clientProvided
104
106
this . ClientProvidedName = clientProvidedName ;
105
107
}
106
108
109
+ private bool ManuallyClosed
110
+ {
111
+ get
112
+ {
113
+ lock ( manuallyClosedLock )
114
+ {
115
+ return manuallyClosed ;
116
+ }
117
+ }
118
+ set
119
+ {
120
+ lock ( manuallyClosedLock )
121
+ {
122
+ manuallyClosed = value ; }
123
+ }
124
+ }
125
+
107
126
public event EventHandler < CallbackExceptionEventArgs > CallbackException
108
127
{
109
128
add
@@ -341,7 +360,7 @@ public void BeginAutomaticRecovery()
341
360
342
361
recoveryTaskFactory . StartNew ( ( ) =>
343
362
{
344
- if ( ! self . manuallyClosed )
363
+ if ( ! self . ManuallyClosed )
345
364
{
346
365
try
347
366
{
@@ -633,56 +652,56 @@ private void Init(AmqpTcpEndpoint endpoint)
633
652
///<summary>API-side invocation of connection abort.</summary>
634
653
public void Abort ( )
635
654
{
636
- this . manuallyClosed = true ;
655
+ this . ManuallyClosed = true ;
637
656
m_delegate . Abort ( ) ;
638
657
}
639
658
640
659
///<summary>API-side invocation of connection abort.</summary>
641
660
public void Abort ( ushort reasonCode , string reasonText )
642
661
{
643
- this . manuallyClosed = true ;
662
+ this . ManuallyClosed = true ;
644
663
m_delegate . Abort ( reasonCode , reasonText ) ;
645
664
}
646
665
647
666
///<summary>API-side invocation of connection abort with timeout.</summary>
648
667
public void Abort ( int timeout )
649
668
{
650
- this . manuallyClosed = true ;
669
+ this . ManuallyClosed = true ;
651
670
m_delegate . Abort ( timeout ) ;
652
671
}
653
672
654
673
///<summary>API-side invocation of connection abort with timeout.</summary>
655
674
public void Abort ( ushort reasonCode , string reasonText , int timeout )
656
675
{
657
- this . manuallyClosed = true ;
676
+ this . ManuallyClosed = true ;
658
677
m_delegate . Abort ( reasonCode , reasonText , timeout ) ;
659
678
}
660
679
661
680
///<summary>API-side invocation of connection.close.</summary>
662
681
public void Close ( )
663
682
{
664
- this . manuallyClosed = true ;
683
+ this . ManuallyClosed = true ;
665
684
m_delegate . Close ( ) ;
666
685
}
667
686
668
687
///<summary>API-side invocation of connection.close.</summary>
669
688
public void Close ( ushort reasonCode , string reasonText )
670
689
{
671
- this . manuallyClosed = true ;
690
+ this . ManuallyClosed = true ;
672
691
m_delegate . Close ( reasonCode , reasonText ) ;
673
692
}
674
693
675
694
///<summary>API-side invocation of connection.close with timeout.</summary>
676
695
public void Close ( int timeout )
677
696
{
678
- this . manuallyClosed = true ;
697
+ this . ManuallyClosed = true ;
679
698
m_delegate . Close ( timeout ) ;
680
699
}
681
700
682
701
///<summary>API-side invocation of connection.close with timeout.</summary>
683
702
public void Close ( ushort reasonCode , string reasonText , int timeout )
684
703
{
685
- this . manuallyClosed = true ;
704
+ this . ManuallyClosed = true ;
686
705
m_delegate . Close ( reasonCode , reasonText , timeout ) ;
687
706
}
688
707
0 commit comments