File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
projects/client/RabbitMQ.Client/src/client/impl Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 43
43
using System . Net ;
44
44
using System . Linq ;
45
45
using System . Threading ;
46
+ using System . Timers ;
46
47
47
48
using RabbitMQ . Client . Impl ;
48
49
using RabbitMQ . Client . Events ;
@@ -513,8 +514,16 @@ public override string ToString()
513
514
514
515
public void BeginAutomaticRecovery ( )
515
516
{
516
- Thread . Sleep ( m_factory . NetworkRecoveryInterval ) ;
517
- lock ( this )
517
+ var t = new System . Timers . Timer ( m_factory . NetworkRecoveryInterval . TotalSeconds * 1000 ) ;
518
+ t . Elapsed += new ElapsedEventHandler ( PerformAutomaticRecovery ) ;
519
+
520
+ t . AutoReset = false ;
521
+ t . Enabled = true ;
522
+ }
523
+
524
+ protected void PerformAutomaticRecovery ( object self , ElapsedEventArgs _e )
525
+ {
526
+ lock ( self )
518
527
{
519
528
this . RecoverConnectionDelegate ( ) ;
520
529
this . RecoverConnectionShutdownHandlers ( ) ;
You can’t perform that action at this time.
0 commit comments