Skip to content

Commit 013132c

Browse files
author
Vlad Ionescu
committed
adding ServerProperties to IConnection API; storing server properties in ConnectionBase
1 parent d2fdef3 commit 013132c

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
@@ -120,6 +120,11 @@ public interface IConnection: IDisposable
120120
///(0 for disabled), in seconds.</summary>
121121
ushort Heartbeat { get; }
122122

123+
///<summary>A dictionary of the server properties sent by the server
124+
///while establishing the connection. This typically includes
125+
///the product name and version of the server.</summary>
126+
IDictionary ServerProperties { get; }
127+
123128
///<summary>Returns the known hosts that came back from the
124129
///broker in the connection.open-ok method at connection
125130
///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;
@@ -258,6 +259,18 @@ public ushort Heartbeat
258259
}
259260
}
260261

262+
public IDictionary ServerProperties
263+
{
264+
get
265+
{
266+
return m_serverProperties;
267+
}
268+
set
269+
{
270+
m_serverProperties = value;
271+
}
272+
}
273+
261274
public AmqpTcpEndpoint[] KnownHosts
262275
{
263276
get { return m_knownHosts; }
@@ -949,6 +962,8 @@ public void Open(bool insist)
949962
ConnectionStartDetails connectionStart = (ConnectionStartDetails)
950963
connectionStartCell.Value;
951964

965+
ServerProperties = connectionStart.m_serverProperties;
966+
952967
AmqpVersion serverVersion = new AmqpVersion(connectionStart.m_versionMajor,
953968
connectionStart.m_versionMinor);
954969
if (!serverVersion.Equals(Protocol.Version))

0 commit comments

Comments
 (0)