@@ -958,54 +958,54 @@ public void ConfirmSelect()
958
958
_Private_ConfirmSelect ( false ) ;
959
959
}
960
960
961
- public bool WaitForConfirms ( TimeSpan timeout , out bool timedOut )
962
- {
963
- var isWaitInfinite = ( timeout . TotalMilliseconds == Timeout . Infinite ) ;
964
- var stopwatch = Stopwatch . StartNew ( ) ;
965
- lock ( m_unconfirmedSet . SyncRoot )
966
- {
967
- while ( true )
968
- {
969
- if ( CloseReason != null )
970
- throw new AlreadyClosedException ( CloseReason ) ;
971
-
972
- if ( m_unconfirmedSet . Count == 0 )
973
- {
974
- bool aux = m_onlyAcksReceived ;
975
- m_onlyAcksReceived = true ;
976
- timedOut = false ;
977
- return aux ;
978
- }
979
- if ( isWaitInfinite )
980
- Monitor . Wait ( m_unconfirmedSet . SyncRoot ) ;
981
- else
982
- {
983
- var elapsed = stopwatch . Elapsed ;
984
- if ( elapsed > timeout || ! Monitor . Wait (
985
- m_unconfirmedSet . SyncRoot , timeout - elapsed ) )
986
- {
987
- timedOut = true ;
988
- return true ;
989
- }
990
- }
991
- }
992
- }
961
+ public bool WaitForConfirms ( TimeSpan timeout , out bool timedOut )
962
+ {
963
+ bool isWaitInfinite = ( timeout . TotalMilliseconds == Timeout . Infinite ) ;
964
+ Stopwatch stopwatch = Stopwatch . StartNew ( ) ;
965
+ lock ( m_unconfirmedSet . SyncRoot )
966
+ {
967
+ while ( true )
968
+ {
969
+ if ( CloseReason != null )
970
+ throw new AlreadyClosedException ( CloseReason ) ;
971
+
972
+ if ( m_unconfirmedSet . Count == 0 )
973
+ {
974
+ bool aux = m_onlyAcksReceived ;
975
+ m_onlyAcksReceived = true ;
976
+ timedOut = false ;
977
+ return aux ;
978
+ }
979
+ if ( isWaitInfinite )
980
+ Monitor . Wait ( m_unconfirmedSet . SyncRoot ) ;
981
+ else
982
+ {
983
+ TimeSpan elapsed = stopwatch . Elapsed ;
984
+ if ( elapsed > timeout || ! Monitor . Wait (
985
+ m_unconfirmedSet . SyncRoot , timeout - elapsed ) )
986
+ {
987
+ timedOut = true ;
988
+ return true ;
989
+ }
990
+ }
991
+ }
992
+ }
993
993
}
994
994
995
995
public bool WaitForConfirms ( )
996
- {
997
- bool timedOut ;
996
+ {
997
+ bool timedOut ;
998
998
return WaitForConfirms ( TimeSpan . FromMilliseconds ( Timeout . Infinite ) , out timedOut ) ;
999
999
}
1000
1000
1001
- public void WaitForConfirmsOrDie ( )
1002
- {
1003
- WaitForConfirmsOrDie ( TimeSpan . FromMilliseconds ( Timeout . Infinite ) ) ;
1004
- }
1005
-
1001
+ public void WaitForConfirmsOrDie ( )
1002
+ {
1003
+ WaitForConfirmsOrDie ( TimeSpan . FromMilliseconds ( Timeout . Infinite ) ) ;
1004
+ }
1005
+
1006
1006
public void WaitForConfirmsOrDie ( TimeSpan timeout )
1007
- {
1008
- bool timedOut ;
1007
+ {
1008
+ bool timedOut ;
1009
1009
bool onlyAcksReceived = WaitForConfirms ( timeout , out timedOut ) ;
1010
1010
if ( ! onlyAcksReceived ) {
1011
1011
Close ( new ShutdownEventArgs ( ShutdownInitiator . Application ,
@@ -1017,7 +1017,7 @@ public void WaitForConfirmsOrDie(TimeSpan timeout)
1017
1017
if ( timedOut ) {
1018
1018
Close ( new ShutdownEventArgs ( ShutdownInitiator . Application ,
1019
1019
CommonFraming . Constants . ReplySuccess ,
1020
- "Timed out waiting for acks" ,
1020
+ "Timed out waiting for acks" ,
1021
1021
new IOException ( "timed out waiting for acks" ) ) ,
1022
1022
false ) ;
1023
1023
throw new IOException ( "Timed out waiting for acks" ) ;
0 commit comments