I am using the SMTP Client from the net mf tool box and I am trying to figure out how to make it time out after 10 seconds when it can't connect to the smtp server. instead it just hangs. I am trying to set the receive timeout on the IntegratedSocket class, but I am not sure if its the connect or the receive time that is failing and so far setting the connect time is failing entirely.
_Sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, ReceiveTimeout);
how do you do a connection time out? I was thinking I start a thread and wait for it, then abort it after the timeout period expires, but was hoping there is a better way.