Search Results

Search found 1 results on 1 pages for 'user1748906'.

Page 1/1 | 1 

  • how to cancel an awaiting task c#

    - by user1748906
    I am trying to cancel a task awaiting for network IO using CancellationTokenSource, but I have to wait until TcpClient connects: try { while (true) { token.Token.ThrowIfCancellationRequested(); Thread.Sleep(int.MaxValue); //simulating a TcpListener waiting for request } } any ideas ? Secondly, is it OK to start each client in a separate task ?

    Read the article

1