The if branch (using Thread.Sleep to wait for ConnectionState.Selected) works fine. The else branch (using the ConnectionChanged EventHandler instead) times out (Secs4Net.SecsException: T3 Timeout!).
await secConnector.StartAsync(cts.Token);
if (false)
{
Thread.Sleep(3000);
Console.WriteLine(secConnector.State);
var s18f10 = await secGem.SendAsync(s18f9);
Console.WriteLine(s18f10.SecsItem[2].GetString());
}
else
{
var t11 = new TaskCompletionSource<bool>();
secConnector.ConnectionChanged += delegate
{
Console.WriteLine(secConnector.State);
if (secConnector.State == ConnectionState.Selected)
{
t11.SetResult(true);
}
};
await t11.Task;
Console.WriteLine(secConnector.State);
var s18f10 = await secGem.SendAsync(s18f9);
Console.WriteLine(s18f10.SecsItem[2].GetString());
}
Probably similar to #34 but the workaround mentioned not working my case.
The if branch (using Thread.Sleep to wait for ConnectionState.Selected) works fine. The else branch (using the ConnectionChanged EventHandler instead) times out (Secs4Net.SecsException: T3 Timeout!).
Probably similar to #34 but the workaround mentioned not working my case.