Skip to content

Commit 727793e

Browse files
author
Matthew Sackman
committed
Merging bug 21939 into default
2 parents 60872e7 + 013132c commit 727793e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ public interface IConnection: IDisposable
116116
///(0 for disabled), in seconds.</summary>
117117
ushort Heartbeat { get; }
118118

119+
///<summary>A dictionary of the server properties sent by the server
120+
///while establishing the connection. This typically includes
121+
///the product name and version of the server.</summary>
122+
IDictionary ServerProperties { get; }
123+
119124
///<summary>Returns the known hosts that came back from the
120125
///broker in the connection.open-ok method at connection
121126
///startup time. Null until the connection is completely open

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public abstract class ConnectionBase : IConnection
9393
public IFrameHandler m_frameHandler;
9494
public uint m_frameMax = 0;
9595
public ushort m_heartbeat = 0;
96+
public IDictionary m_serverProperties;
9697
public AmqpTcpEndpoint[] m_knownHosts = null;
9798

9899
public MainSession m_session0;
@@ -250,6 +251,18 @@ public ushort Heartbeat
250251
}
251252
}
252253

254+
public IDictionary ServerProperties
255+
{
256+
get
257+
{
258+
return m_serverProperties;
259+
}
260+
set
261+
{
262+
m_serverProperties = value;
263+
}
264+
}
265+
253266
public AmqpTcpEndpoint[] KnownHosts
254267
{
255268
get { return m_knownHosts; }
@@ -941,6 +954,8 @@ public void Open(bool insist)
941954
ConnectionStartDetails connectionStart = (ConnectionStartDetails)
942955
connectionStartCell.Value;
943956

957+
ServerProperties = connectionStart.m_serverProperties;
958+
944959
AmqpVersion serverVersion = new AmqpVersion(connectionStart.m_versionMajor,
945960
connectionStart.m_versionMinor);
946961
if (!serverVersion.Equals(Protocol.Version))

0 commit comments

Comments
 (0)