Skip to content

Commit 6aa2359

Browse files
author
Alexandru Scvortov
committed
refactored QuiescingSession
1 parent 361f9b6 commit 6aa2359

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

projects/client/RabbitMQ.Client/src/client/impl/QuiescingSession.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,38 +73,30 @@ namespace RabbitMQ.Client.Impl
7373
public class QuiescingSession: SessionBase
7474
{
7575
public ShutdownEventArgs m_reason;
76-
protected int m_closeClassId;
77-
protected int m_closeMethodId;
78-
protected int m_closeOkClassId;
79-
protected int m_closeOkMethodId;
8076

8177
public QuiescingSession(ConnectionBase connection,
8278
int channelNumber,
8379
ShutdownEventArgs reason)
8480
: base(connection, channelNumber)
8581
{
8682
m_reason = reason;
87-
m_closeClassId = CommonFramingSpecs.ChannelClose.ClassId;
88-
m_closeMethodId = CommonFramingSpecs.ChannelClose.MethodId;
89-
m_closeOkClassId = CommonFramingSpecs.ChannelCloseOk.ClassId;
90-
m_closeOkMethodId = CommonFramingSpecs.ChannelCloseOk.MethodId;
9183
}
9284

9385
public override void HandleFrame(Frame frame)
9486
{
9587
if (frame.Type == CommonFraming.Constants.FrameMethod) {
9688
MethodBase method = Connection.Protocol.DecodeMethodFrom(frame.GetReader());
97-
if ((method.ProtocolClassId == m_closeOkClassId)
98-
&& (method.ProtocolMethodId == m_closeOkMethodId))
89+
if ((method.ProtocolClassId == CommonFramingSpecs.ChannelCloseOk.ClassId)
90+
&& (method.ProtocolMethodId == CommonFramingSpecs.ChannelCloseOk.MethodId))
9991
{
10092
// This is the reply we were looking for. Release
10193
// the channel with the reason we were passed in
10294
// our constructor.
10395
Close(m_reason);
10496
return;
10597
}
106-
else if ((method.ProtocolClassId == m_closeClassId)
107-
&& (method.ProtocolMethodId == m_closeMethodId))
98+
else if ((method.ProtocolClassId == CommonFramingSpecs.ChannelClose.ClassId)
99+
&& (method.ProtocolMethodId == CommonFramingSpecs.ChannelClose.MethodId))
108100
{
109101
// We're already shutting down the channel, so
110102
// just send back an ok.

0 commit comments

Comments
 (0)