Socket.BeginConnect timeout

C

Clark

Is there any way to abort a connection attempt after a few seconds if it
does not succeed?

When I call the BeginConnect method, if the remote endpoint does not exist,
it waits something like 20 seconds before returning an exception. Somehow I
would like to start a timer when the BeginConnect method is called, and if
it elapses before the connection is established, to abort the pool thread
that is executing the callback. How can I do this?

Clark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top