Exemple #1
0
        public override async ValueTask AttachAsync(ServiceParameterBufferBase spb, string dataSource, int port, string service, byte[] cryptKey, CancellationToken cancellationToken = default)
        {
            try
            {
                await SendAttachToBufferAsync(spb, service, cancellationToken).ConfigureAwait(false);

                await _database.Xdr.FlushAsync(cancellationToken).ConfigureAwait(false);
                await ProcessAttachResponseAsync((GenericResponse)await _database.ReadResponseAsync(cancellationToken).ConfigureAwait(false), cancellationToken).ConfigureAwait(false);
            }
            catch (IOException ex)
            {
                await _database.DetachAsync(cancellationToken).ConfigureAwait(false);

                throw IscException.ForIOException(ex);
            }
        }