/// <summary>
/// <para>Create topology.</para>
/// </summary>
/// <param name="defaultConfig">Default config.</param>
/// <param name="maxDefaultConnections">Maximum default connections.</param>
public HostTopology(ConnectionConfig defaultConfig, int maxDefaultConnections)
{
if (defaultConfig == null)
{
throw new NullReferenceException("config is not defined");
}
if (maxDefaultConnections <= 0)
{
throw new ArgumentOutOfRangeException("maxDefaultConnections", "count connection should be > 0");
}
if (maxDefaultConnections > 65535)
{
throw new ArgumentOutOfRangeException("maxDefaultConnections", "count connection should be < 65535");
}
ConnectionConfig.Validate(defaultConfig);
this.m_DefConfig = new ConnectionConfig(defaultConfig);
this.m_MaxDefConnections = maxDefaultConnections;
}