title: TcpClient.ConnectAsync or Socket.BeginConnect with non-blocking timeout setting
body: <p>All solutions I found so far are based on WaitOne:
  <a href="https://stackoverflow.com/questions/1062035/how-to-configure-socket-connect-timeout">How to configure socket connect timeout</a>
  or <a href="http://www.splinter.com.au/opening-a-tcp-connection-in-c-with-a-custom-t/" rel="nofollow noreferrer">spawning a worker thread</a></p>
  
  <p>For me, blocking the thread with <code>WaitOne</code> defeats the purpose of async methods. Spawning another thread is not much better (as async model strives to use as less threads as possible).</p>
  
  <p>Is there any other solution which would still let me abort the connection attempt without blocking the current thread or spawning another one?</p>
  
  <p>I'm developing a library used by external code which has no knowledge of what's going on inside my library (the code just calls my ConnectAsync method and I do the rest including <code>TcpClient.ConnectAsync</code> and so on). The external code can be anything (web app, desktop app, Windows service, whatever). Ideally, the solution should not require the external code to do anything to abort the operation beyond setting .Timeout property of my class. However, if it's the only the way to avoid blocks or worker threads when implementing custom connection timeout, I'd be grateful to see which options I have (in terms of async/await model).</p>