@@ -230,14 +230,16 @@ public void releaseChannelNumber() {
230
230
// incoming commands except for a close and close-ok.
231
231
232
232
Method method = command .getMethod ();
233
+ // we deal with channel.close in the same way, regardless
234
+ if (method instanceof Channel .Close ) {
235
+ asyncShutdown (command );
236
+ return true ;
237
+ }
233
238
234
239
if (isOpen ()) {
235
240
// We're in normal running mode.
236
241
237
- if (method instanceof Channel .Close ) {
238
- asyncShutdown (command );
239
- return true ;
240
- } else if (method instanceof Basic .Deliver ) {
242
+ if (method instanceof Basic .Deliver ) {
241
243
Basic .Deliver m = (Basic .Deliver ) method ;
242
244
243
245
Consumer callback = _consumers .get (m .consumerTag );
@@ -343,11 +345,7 @@ public void releaseChannelNumber() {
343
345
} else {
344
346
// We're in quiescing mode == !isOpen()
345
347
346
- if (method instanceof Channel .Close ) {
347
- // We are already shutting down, but we cannot assume no Rpc is waiting.
348
- asyncShutdown (command );
349
- return true ;
350
- } else if (method instanceof Channel .CloseOk ) {
348
+ if (method instanceof Channel .CloseOk ) {
351
349
// We're quiescing, and we see a channel.close-ok:
352
350
// this is our signal to leave quiescing mode and
353
351
// finally shut down for good. Let it be handled as an
0 commit comments