@@ -494,16 +494,7 @@ public void Enqueue(IRpcContinuation k)
494
494
public void TransmitAndEnqueue ( Command cmd , IRpcContinuation k )
495
495
{
496
496
Enqueue ( k ) ;
497
- try
498
- {
499
- m_session . Transmit ( cmd ) ;
500
- }
501
- catch ( AlreadyClosedException )
502
- {
503
- // Ignored, since the continuation will be told about
504
- // the closure via an OperationInterruptedException because
505
- // of the shutdown event propagation.
506
- }
497
+ m_session . Transmit ( cmd ) ;
507
498
}
508
499
509
500
public ShutdownEventArgs CloseReason
@@ -894,16 +885,7 @@ private QueueDeclareOk QueueDeclare(string queue, bool passive, bool durable, bo
894
885
{
895
886
QueueDeclareRpcContinuation k = new QueueDeclareRpcContinuation ( ) ;
896
887
Enqueue ( k ) ;
897
- try
898
- {
899
- _Private_QueueDeclare ( queue , passive , durable , exclusive , autoDelete , false , arguments ) ;
900
- }
901
- catch ( AlreadyClosedException )
902
- {
903
- // Ignored, since the continuation will be told about
904
- // the closure via an OperationInterruptedException because
905
- // of the shutdown event propagation.
906
- }
888
+ _Private_QueueDeclare ( queue , passive , durable , exclusive , autoDelete , false , arguments ) ;
907
889
k . GetReply ( ) ;
908
890
return k . m_result ;
909
891
}
@@ -988,7 +970,7 @@ public bool WaitForConfirms(TimeSpan timeout, out bool timedOut)
988
970
{
989
971
while ( true )
990
972
{
991
- if ( CloseReason != null )
973
+ if ( ! IsOpen )
992
974
throw new AlreadyClosedException ( CloseReason ) ;
993
975
994
976
if ( m_unconfirmedSet . Count == 0 )
@@ -1095,17 +1077,8 @@ public string BasicConsume(string queue,
1095
1077
Enqueue ( k ) ;
1096
1078
// Non-nowait. We have an unconventional means of getting
1097
1079
// the RPC response, but a response is still expected.
1098
- try
1099
- {
1100
- _Private_BasicConsume ( queue , consumerTag , noLocal , noAck , exclusive ,
1080
+ _Private_BasicConsume ( queue , consumerTag , noLocal , noAck , exclusive ,
1101
1081
/*nowait:*/ false , arguments ) ;
1102
- }
1103
- catch ( AlreadyClosedException )
1104
- {
1105
- // Ignored, since the continuation will be told about
1106
- // the closure via an OperationInterruptedException because
1107
- // of the shutdown event propagation.
1108
- }
1109
1082
k . GetReply ( ) ;
1110
1083
string actualConsumerTag = k . m_consumerTag ;
1111
1084
@@ -1141,17 +1114,7 @@ public void BasicCancel(string consumerTag)
1141
1114
1142
1115
Enqueue ( k ) ;
1143
1116
1144
- try
1145
- {
1146
- _Private_BasicCancel ( consumerTag , false ) ;
1147
- }
1148
- catch ( AlreadyClosedException )
1149
- {
1150
- // Ignored, since the continuation will be told about
1151
- // the closure via an OperationInterruptedException because
1152
- // of the shutdown event propagation.
1153
- }
1154
-
1117
+ _Private_BasicCancel ( consumerTag , false ) ;
1155
1118
k . GetReply ( ) ;
1156
1119
1157
1120
ModelShutdown -= new ModelShutdownEventHandler ( k . m_consumer . HandleModelShutdown ) ;
@@ -1197,16 +1160,7 @@ public BasicGetResult BasicGet(string queue,
1197
1160
{
1198
1161
BasicGetRpcContinuation k = new BasicGetRpcContinuation ( ) ;
1199
1162
Enqueue ( k ) ;
1200
- try
1201
- {
1202
- _Private_BasicGet ( queue , noAck ) ;
1203
- }
1204
- catch ( AlreadyClosedException )
1205
- {
1206
- // Ignored, since the continuation will be told about
1207
- // the closure via an OperationInterruptedException because
1208
- // of the shutdown event propagation.
1209
- }
1163
+ _Private_BasicGet ( queue , noAck ) ;
1210
1164
k . GetReply ( ) ;
1211
1165
return k . m_result ;
1212
1166
}
@@ -1218,18 +1172,7 @@ public void BasicRecover(bool requeue)
1218
1172
SimpleBlockingRpcContinuation k = new SimpleBlockingRpcContinuation ( ) ;
1219
1173
1220
1174
Enqueue ( k ) ;
1221
-
1222
- try
1223
- {
1224
- _Private_BasicRecover ( requeue ) ;
1225
- }
1226
- catch ( AlreadyClosedException )
1227
- {
1228
- // Ignored, since the continuation will be told about
1229
- // the closure via an OperationInterruptedException because
1230
- // of the shutdown event propagation.
1231
- }
1232
-
1175
+ _Private_BasicRecover ( requeue ) ;
1233
1176
k . GetReply ( ) ;
1234
1177
}
1235
1178
0 commit comments