You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
namespace CancellationTokenTest
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
Client client = new Client();
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
if (i % 2 == 0)
|
|
{
|
|
client.Start();
|
|
}
|
|
else
|
|
{
|
|
client.Cancel();
|
|
}
|
|
|
|
//await Task.Delay(1000);
|
|
Thread.Sleep(1000);
|
|
}
|
|
}
|
|
}
|
|
} |