Ejemplo n.º 1
0
        public async Task ReleaseConnectionAsync(IotHubConnection connection)
        {
            CachedConnection cachedConnection;

            if (connection.ConnectionString.SharedAccessKeyName != null &&
                this.connections.TryGetValue(connection.ConnectionString, out cachedConnection))
            {
                cachedConnection.Release();
            }
            else
            {
                await connection.CloseAsync();
            }
        }