コード例 #1
0
        public async Task ConnectAsync(TimeSpan timeout)
        {
            // using async lock
            using (await _lock.LockAsync())
            {
                if (_connection != null && _connection.CheckState())
                {
                    return;
                }

                if (_connection != null && !_connection.CheckState())
                {
                    await _connection.ShutdowmAsync();
                }

                _connection = new GrpcConnection(GetServer(_connection?.Server));
                await _connection.ConnectAsync(timeout);
            }
        }
コード例 #2
0
 public async Task ShutdownAsync()
 {
     await _connection?.ShutdowmAsync();
 }