Exemple #1
0
 public override bool TryConnect(out string message)
 {
     try
     {
         message = "Connected.";
         api.SetOptions(Options);
         var task = api.Connect();
         task.Wait();
         return(true);
     }
     catch (Exception ex)
     {
         message = ex.ToString();
         return(false);
     }
 }
Exemple #2
0
        public override bool TryConnect(out string message)
        {
            Task runner = null;

            try
            {
                message = "Connected.";
                api.SetOptions(Options);
                runner = api.Connect();
                runner.Wait();
                return(true);
            }
            catch (Exception ex)
            {
                message = ex.ToString();
                return(false);
            }
            finally
            {
                runner?.Dispose();
            }
        }