Skip to content

Commit 8dd50c4

Browse files
author
Simon MacMullen
committed
Merge 22653 into default.
2 parents 05d7c29 + c90d861 commit 8dd50c4

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ namespace RabbitMQ.Client
8888
/// //
8989
/// // ... use ch's IModel methods ...
9090
/// //
91-
/// ch.Close(200, "Closing the channel");
92-
/// conn.Close(200, "Closing the connection");
91+
/// ch.Close(Constants.ReplySuccess, "Closing the channel");
92+
/// conn.Close(Constants.ReplySuccess, "Closing the connection");
9393
///</code></example>
9494
///<para>
9595
/// Please see also the API overview and tutorial in the User Guide.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ void IDisposable.Dispose()
370370
///<summary>API-side invocation of connection close.</summary>
371371
public void Close()
372372
{
373-
Close(200, "Goodbye", Timeout.Infinite);
373+
Close(CommonFraming.Constants.ReplySuccess, "Goodbye", Timeout.Infinite);
374374
}
375375

376376
///<summary>API-side invocation of connection close.</summary>
@@ -382,7 +382,7 @@ public void Close(ushort reasonCode, string reasonText)
382382
///<summary>API-side invocation of connection close with timeout.</summary>
383383
public void Close(int timeout)
384384
{
385-
Close(200, "Goodbye", timeout);
385+
Close(CommonFraming.Constants.ReplySuccess, "Goodbye", timeout);
386386
}
387387

388388
///<summary>API-side invocation of connection close with timeout.</summary>
@@ -411,7 +411,7 @@ public void Abort(ushort reasonCode, string reasonText)
411411
///<summary>API-side invocation of connection abort with timeout.</summary>
412412
public void Abort(int timeout)
413413
{
414-
Abort(200, "Connection close forced", timeout);
414+
Abort(CommonFraming.Constants.ReplySuccess, "Connection close forced", timeout);
415415
}
416416

417417
///<summary>API-side invocation of connection abort with timeout.</summary>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
using System;
5858
using System.IO;
5959
using System.Collections;
60+
using System.Diagnostics;
6061
using System.Threading;
6162

6263
using RabbitMQ.Client;
@@ -69,7 +70,6 @@
6970
// we support*. Obviously we may need to revisit this if that ever
7071
// changes.
7172
using CommonFraming = RabbitMQ.Client.Framing.v0_9;
72-
using System.Diagnostics;
7373

7474
namespace RabbitMQ.Client.Impl
7575
{
@@ -808,7 +808,7 @@ void IDisposable.Dispose()
808808

809809
public void Close()
810810
{
811-
Close(200, "Goodbye");
811+
Close(CommonFraming.Constants.ReplySuccess, "Goodbye");
812812
}
813813

814814
public void Close(ushort replyCode, string replyText)
@@ -818,7 +818,7 @@ public void Close(ushort replyCode, string replyText)
818818

819819
public void Abort()
820820
{
821-
Abort(200, "Goodbye");
821+
Abort(CommonFraming.Constants.ReplySuccess, "Goodbye");
822822
}
823823

824824
public void Abort(ushort replyCode, string replyText)

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
using RabbitMQ.Client.Exceptions;
6363
using RabbitMQ.Util;
6464

65+
// We use spec version 0-9 for common constants such as frame types,
66+
// error codes, and the frame end byte, since they don't vary *within
67+
// the versions we support*. Obviously we may need to revisit this if
68+
// that ever changes.
69+
using CommonFraming = RabbitMQ.Client.Framing.v0_9;
70+
6571
namespace RabbitMQ.Client.Impl
6672
{
6773
public class SessionManager
@@ -203,7 +209,7 @@ public void CheckAutoClose()
203209
///when we decide to close the connection.</summary>
204210
public void AutoCloseConnection()
205211
{
206-
m_connection.Abort(200, "AutoClose", ShutdownInitiator.Library, Timeout.Infinite);
212+
m_connection.Abort(CommonFraming.Constants.ReplySuccess, "AutoClose", ShutdownInitiator.Library, Timeout.Infinite);
207213
}
208214
}
209215
}

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)