@@ -971,15 +971,18 @@ private static uint NegotiatedMaxValue(uint clientValue, uint serverValue)
971
971
Math . Min ( clientValue , serverValue ) ;
972
972
}
973
973
974
- public void Open ( bool insist )
974
+ /// <summary>
975
+ /// Connection opening, common to all supported protocol versions
976
+ /// </summary>
977
+ protected void OpenCommon ( )
975
978
{
976
979
BlockingCell connectionStartCell = new BlockingCell ( ) ;
977
980
m_model0 . m_connectionStartCell = connectionStartCell ;
978
981
m_frameHandler . Timeout = HandshakeTimeout ;
979
982
m_frameHandler . SendHeader ( ) ;
980
983
981
984
ConnectionStartDetails connectionStart = ( ConnectionStartDetails )
982
- connectionStartCell . Value ;
985
+ connectionStartCell . Value ;
983
986
984
987
ServerProperties = connectionStart . m_serverProperties ;
985
988
@@ -1002,13 +1005,13 @@ public void Open(bool insist)
1002
1005
ConnectionTuneDetails connectionTune = default ( ConnectionTuneDetails ) ;
1003
1006
try
1004
1007
{
1005
- connectionTune =
1006
- m_model0 . ConnectionStartOk ( m_clientProperties ,
1007
- "PLAIN" ,
1008
- Encoding . UTF8 . GetBytes (
1009
- "\0 " + m_factory . UserName +
1010
- "\0 " + m_factory . Password ) ,
1011
- "en_US" ) ;
1008
+ connectionTune =
1009
+ m_model0 . ConnectionStartOk ( m_clientProperties ,
1010
+ "PLAIN" ,
1011
+ Encoding . UTF8 . GetBytes (
1012
+ "\0 " + m_factory . UserName +
1013
+ "\0 " + m_factory . Password ) ,
1014
+ "en_US" ) ;
1012
1015
}
1013
1016
catch ( OperationInterruptedException e )
1014
1017
{
@@ -1031,18 +1034,15 @@ public void Open(bool insist)
1031
1034
m_model0 . ConnectionTuneOk ( channelMax ,
1032
1035
frameMax ,
1033
1036
heartbeat ) ;
1037
+ }
1034
1038
1035
- if ( Protocol . SupportsRedirect )
1036
- {
1037
- string knownHosts = m_model0 . ConnectionOpen ( m_factory . VirtualHost ,
1038
- "" , // FIXME: make configurable?
1039
- insist ) ;
1040
- KnownHosts = AmqpTcpEndpoint . ParseMultiple ( Protocol , knownHosts ) ;
1041
- }
1042
- else
1043
- {
1044
- m_model0 . ConnectionOpen ( m_factory . VirtualHost , String . Empty , false ) ;
1045
- }
1039
+ public virtual void Open ( bool insist )
1040
+ {
1041
+ OpenCommon ( ) ;
1042
+ string knownHosts = m_model0 . ConnectionOpen ( m_factory . VirtualHost ,
1043
+ "" , // FIXME: make configurable?
1044
+ insist ) ;
1045
+ KnownHosts = AmqpTcpEndpoint . ParseMultiple ( Protocol , knownHosts ) ;
1046
1046
}
1047
1047
1048
1048
public override string ToString ( )
0 commit comments