Socket.connect or Socket.BeginConnect timeout

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Joe Bloggs (anonymous_at_discussions.microsoft.com)
Date: 04/23/04


Date: Fri, 23 Apr 2004 12:51:05 -0700

Hello,

Is it possible to set a timeout on the Socket.Connect or Socket.BeginConnect methods? I am writing an ftp client and do not want the application to wait the default 2 minutes or so to time out when it cannot connect to the server. It seems you can set a timeout on send and receive operations but I cannot find one for connect. Any suggestion would be greatly appreciated.

Note: I am developing using C# and Visual Studio.NET 2003

Cheers,
Joe