@@ -94,6 +94,8 @@ public abstract class ConnectionBase : IConnection
94
94
public IFrameHandler m_frameHandler ;
95
95
public uint m_frameMax = 0 ;
96
96
public ushort m_heartbeat = 0 ;
97
+ public IDictionary m_clientProperties ;
98
+ public IDictionary m_serverProperties ;
97
99
public AmqpTcpEndpoint [ ] m_knownHosts = null ;
98
100
99
101
public MainSession m_session0 ;
@@ -251,6 +253,30 @@ public ushort Heartbeat
251
253
}
252
254
}
253
255
256
+ public IDictionary ClientProperties
257
+ {
258
+ get
259
+ {
260
+ return new Hashtable ( m_clientProperties ) ;
261
+ }
262
+ set
263
+ {
264
+ m_clientProperties = value ;
265
+ }
266
+ }
267
+
268
+ public IDictionary ServerProperties
269
+ {
270
+ get
271
+ {
272
+ return m_serverProperties ;
273
+ }
274
+ set
275
+ {
276
+ m_serverProperties = value ;
277
+ }
278
+ }
279
+
254
280
public AmqpTcpEndpoint [ ] KnownHosts
255
281
{
256
282
get { return m_knownHosts ; }
@@ -905,9 +931,11 @@ public void OnCallbackException(CallbackExceptionEventArgs args)
905
931
}
906
932
}
907
933
908
- public IDictionary BuildClientPropertiesTable ( )
934
+ public static IDictionary DefaultClientProperties ( )
909
935
{
910
- string version = this . GetType ( ) . Assembly . GetName ( ) . Version . ToString ( ) ;
936
+ System . Reflection . Assembly assembly =
937
+ System . Reflection . Assembly . GetAssembly ( typeof ( ConnectionBase ) ) ;
938
+ string version = assembly . GetName ( ) . Version . ToString ( ) ;
911
939
//TODO: Get the rest of this data from the Assembly Attributes
912
940
Hashtable table = new Hashtable ( ) ;
913
941
table [ "product" ] = Encoding . UTF8 . GetBytes ( "RabbitMQ" ) ;
@@ -950,6 +978,8 @@ public void Open(bool insist)
950
978
ConnectionStartDetails connectionStart = ( ConnectionStartDetails )
951
979
connectionStartCell . Value ;
952
980
981
+ ServerProperties = connectionStart . m_serverProperties ;
982
+
953
983
AmqpVersion serverVersion = new AmqpVersion ( connectionStart . m_versionMajor ,
954
984
connectionStart . m_versionMinor ) ;
955
985
if ( ! serverVersion . Equals ( Protocol . Version ) )
@@ -962,10 +992,12 @@ public void Open(bool insist)
962
992
serverVersion . Minor ) ;
963
993
}
964
994
995
+ m_clientProperties = new Hashtable ( m_factory . ClientProperties ) ;
996
+
965
997
// FIXME: check that PLAIN is supported.
966
998
// FIXME: parse out locales properly!
967
999
ConnectionTuneDetails connectionTune =
968
- m_model0 . ConnectionStartOk ( BuildClientPropertiesTable ( ) ,
1000
+ m_model0 . ConnectionStartOk ( m_clientProperties ,
969
1001
"PLAIN" ,
970
1002
Encoding . UTF8 . GetBytes ( "\0 " + m_factory . UserName +
971
1003
"\0 " + m_factory . Password ) ,
0 commit comments