This project has moved. For the latest updates, please go here.

ConnectAsync Method timeout time ?

Sep 6, 2012 at 2:49 PM

what is the ConnectAsync Method timeout time ?

Sep 11, 2012 at 5:48 PM

ConnectAsync is a wrapper around Socket.BeginConnect, which is a wrapper around WSAConnect, which just uses the underlying TCP/IP transport stack timeout.

IIRC, the TCP/IP timeout is ~30 seconds (which is actually several timeouts put together with retries), but could change dynamically based on the speed of other connections over that network interface. I don't believe there is a way to set this other than in the registry.

Usually, if you want a shorter timeout, you have a separate timer and close the socket if it hasn't connected within the specified time.