2using System.Threading.Tasks;
9 internal class ConnectionTask : MqTask
11 private readonly TaskCompletionSource<bool> result;
12 private readonly
string userName;
13 private readonly
string password;
21 public ConnectionTask(
MqClient Client,
string UserName,
string Password)
24 this.userName = UserName;
25 this.password = Password;
26 this.result =
new TaskCompletionSource<bool>();
32 public Task Completed => this.result.Task;
38 public override bool DoWork()
42 this.Client.
Connect(this.userName, this.password);
43 this.result.TrySetResult(
true);
47 this.result.TrySetException(ex);
void Connect(string UserName, string Password)
Connects to the Queue Manager