public IotHubSingleTokenConnection(IotHubScopeConnectionPool iotHubScopeConnectionPool, IotHubConnectionString connectionString, AmqpTransportSettings amqpTransportSettings) : base(connectionString.HostName, connectionString.AmqpEndpoint.Port, amqpTransportSettings) { this.iotHubScopeConnectionPool = iotHubScopeConnectionPool; this.ConnectionString = connectionString; this.FaultTolerantSession = new FaultTolerantAmqpObject <AmqpSession>(this.CreateSessionAsync, this.CloseConnection); }
public override void Release(string doNotUse) { if (this.iotHubScopeConnectionPool != null) { this.iotHubScopeConnectionPool.RemoveRef(); this.iotHubScopeConnectionPool = null; } else { this.FaultTolerantSession.Close(); } }