@@ -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
@@ -102,6 +104,23 @@ public AutorecoveringConnection(ConnectionFactory factory, string clientProvided
102
104
this . ClientProvidedName = clientProvidedName ;
103
105
}
104
106
107
+ private bool ManuallyClosed
108
+ {
109
+ get
110
+ {
111
+ lock ( manuallyClosedLock )
112
+ {
113
+ return manuallyClosed ;
114
+ }
115
+ }
116
+ set
117
+ {
118
+ lock ( manuallyClosedLock )
119
+ {
120
+ manuallyClosed = value ; }
121
+ }
122
+ }
123
+
105
124
public event EventHandler < CallbackExceptionEventArgs > CallbackException
106
125
{
107
126
add
@@ -339,7 +358,7 @@ public void BeginAutomaticRecovery()
339
358
340
359
recoveryTaskFactory . StartNew ( ( ) =>
341
360
{
342
- if ( ! self . manuallyClosed )
361
+ if ( ! self . ManuallyClosed )
343
362
{
344
363
try
345
364
{
@@ -600,56 +619,56 @@ private void Init(IFrameHandler fh)
600
619
///<summary>API-side invocation of connection abort.</summary>
601
620
public void Abort ( )
602
621
{
603
- this . manuallyClosed = true ;
622
+ this . ManuallyClosed = true ;
604
623
m_delegate . Abort ( ) ;
605
624
}
606
625
607
626
///<summary>API-side invocation of connection abort.</summary>
608
627
public void Abort ( ushort reasonCode , string reasonText )
609
628
{
610
- this . manuallyClosed = true ;
629
+ this . ManuallyClosed = true ;
611
630
m_delegate . Abort ( reasonCode , reasonText ) ;
612
631
}
613
632
614
633
///<summary>API-side invocation of connection abort with timeout.</summary>
615
634
public void Abort ( int timeout )
616
635
{
617
- this . manuallyClosed = true ;
636
+ this . ManuallyClosed = true ;
618
637
m_delegate . Abort ( timeout ) ;
619
638
}
620
639
621
640
///<summary>API-side invocation of connection abort with timeout.</summary>
622
641
public void Abort ( ushort reasonCode , string reasonText , int timeout )
623
642
{
624
- this . manuallyClosed = true ;
643
+ this . ManuallyClosed = true ;
625
644
m_delegate . Abort ( reasonCode , reasonText , timeout ) ;
626
645
}
627
646
628
647
///<summary>API-side invocation of connection.close.</summary>
629
648
public void Close ( )
630
649
{
631
- this . manuallyClosed = true ;
650
+ this . ManuallyClosed = true ;
632
651
m_delegate . Close ( ) ;
633
652
}
634
653
635
654
///<summary>API-side invocation of connection.close.</summary>
636
655
public void Close ( ushort reasonCode , string reasonText )
637
656
{
638
- this . manuallyClosed = true ;
657
+ this . ManuallyClosed = true ;
639
658
m_delegate . Close ( reasonCode , reasonText ) ;
640
659
}
641
660
642
661
///<summary>API-side invocation of connection.close with timeout.</summary>
643
662
public void Close ( int timeout )
644
663
{
645
- this . manuallyClosed = true ;
664
+ this . ManuallyClosed = true ;
646
665
m_delegate . Close ( timeout ) ;
647
666
}
648
667
649
668
///<summary>API-side invocation of connection.close with timeout.</summary>
650
669
public void Close ( ushort reasonCode , string reasonText , int timeout )
651
670
{
652
- this . manuallyClosed = true ;
671
+ this . ManuallyClosed = true ;
653
672
m_delegate . Close ( reasonCode , reasonText , timeout ) ;
654
673
}
655
674
0 commit comments