@@ -94,6 +94,8 @@ public abstract class ConnectionBase : IConnection
9494 public IFrameHandler m_frameHandler ;
9595 public uint m_frameMax = 0 ;
9696 public ushort m_heartbeat = 0 ;
97+ public IDictionary m_clientProperties ;
98+ public IDictionary m_serverProperties ;
9799 public AmqpTcpEndpoint [ ] m_knownHosts = null ;
98100
99101 public MainSession m_session0 ;
@@ -251,6 +253,30 @@ public ushort Heartbeat
251253 }
252254 }
253255
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+
254280 public AmqpTcpEndpoint [ ] KnownHosts
255281 {
256282 get { return m_knownHosts ; }
@@ -905,9 +931,11 @@ public void OnCallbackException(CallbackExceptionEventArgs args)
905931 }
906932 }
907933
908- public IDictionary BuildClientPropertiesTable ( )
934+ public static IDictionary DefaultClientProperties ( )
909935 {
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 ( ) ;
911939 //TODO: Get the rest of this data from the Assembly Attributes
912940 Hashtable table = new Hashtable ( ) ;
913941 table [ "product" ] = Encoding . UTF8 . GetBytes ( "RabbitMQ" ) ;
@@ -950,6 +978,8 @@ public void Open(bool insist)
950978 ConnectionStartDetails connectionStart = ( ConnectionStartDetails )
951979 connectionStartCell . Value ;
952980
981+ ServerProperties = connectionStart . m_serverProperties ;
982+
953983 AmqpVersion serverVersion = new AmqpVersion ( connectionStart . m_versionMajor ,
954984 connectionStart . m_versionMinor ) ;
955985 if ( ! serverVersion . Equals ( Protocol . Version ) )
@@ -962,10 +992,12 @@ public void Open(bool insist)
962992 serverVersion . Minor ) ;
963993 }
964994
995+ m_clientProperties = new Hashtable ( m_factory . ClientProperties ) ;
996+
965997 // FIXME: check that PLAIN is supported.
966998 // FIXME: parse out locales properly!
967999 ConnectionTuneDetails connectionTune =
968- m_model0 . ConnectionStartOk ( BuildClientPropertiesTable ( ) ,
1000+ m_model0 . ConnectionStartOk ( m_clientProperties ,
9691001 "PLAIN" ,
9701002 Encoding . UTF8 . GetBytes ( "\0 " + m_factory . UserName +
9711003 "\0 " + m_factory . Password ) ,
0 commit comments