Skip to content

Commit c90d861

Browse files
author
Emile Joubert
committed
Use protocol value for reply success in service model
1 parent ba10eda commit c90d861

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

projects/wcf/RabbitMQ.ServiceModel/src/serviceModel/CurrentVersion.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ namespace RabbitMQ.ServiceModel
6363
using System;
6464
using System.Text;
6565

66+
// We use spec version 0-9 for common constants such as frame types,
67+
// error codes, and the frame end byte, since they don't vary *within
68+
// the versions we support*. Obviously we may need to revisit this if
69+
// that ever changes.
70+
using CommonFraming = RabbitMQ.Client.Framing.v0_9;
71+
6672
/// <summary>
6773
/// Properties of the current RabbitMQ Service Model Version
6874
/// </summary>
@@ -74,7 +80,7 @@ public static class CurrentVersion
7480

7581
internal static class StatusCodes
7682
{
77-
public const int Ok = 200;
83+
public const int Ok = CommonFraming.Constants.ReplySuccess;
7884
}
7985

8086
}

projects/wcf/RabbitMQ.ServiceModel/src/serviceModel/RabbitMQInputChannel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ namespace RabbitMQ.ServiceModel
6969
using RabbitMQ.Client;
7070
using RabbitMQ.Client.Events;
7171

72+
// We use spec version 0-9 for common constants such as frame types,
73+
// error codes, and the frame end byte, since they don't vary *within
74+
// the versions we support*. Obviously we may need to revisit this if
75+
// that ever changes.
76+
using CommonFraming = RabbitMQ.Client.Framing.v0_9;
77+
7278
internal sealed class RabbitMQInputChannel : RabbitMQInputChannelBase
7379
{
7480
private RabbitMQTransportBindingElement m_bindingElement;
@@ -109,7 +115,7 @@ public override Message Receive(TimeSpan timeout)
109115
}
110116
catch (EndOfStreamException)
111117
{
112-
if (m_messageQueue== null || m_messageQueue.ShutdownReason != null && m_messageQueue.ShutdownReason.ReplyCode != 200)
118+
if (m_messageQueue== null || m_messageQueue.ShutdownReason != null && m_messageQueue.ShutdownReason.ReplyCode != CommonFraming.Constants.ReplySuccess)
113119
{
114120
OnFaulted();
115121
}

0 commit comments

Comments
 (0)