Opa wrote:
> Hi,
>
> .NET Sockets does not provide a ConnectTimeout when calling the
> Connect method while establishing a Synchronous socket connection.
> Instead, my app is forced to wait a very long time before and
> Exception is thrown if the server i'm trying to connect to is not
> listening.
You can specify both send and receive timeouts using
Socket.SetSocketOption(), e.g.
int timeout = 2000; // in milliseconds
socket.SetSocketOption(
SocketOptionLevel.Socket,
SocketOptionName.SendTimeout,
timeout);
Cheers,
--
http://www.joergjooss.de
mailto:news-(E-Mail Removed)