Palaniappan wrote:
HI,
I need to set the timeout value for the sockets to handle network
timeout in C#. I search for some API which is equivalent to that of the
setSoTimeout() method in Java.
Could any one of you please help me out?
Thanks,
Palaniappan.
Hi Palaniappan,
If you have a socket object, you can do this:
///
mySocketObj.SetSocketOption( SocketOptionLevel.Socket,
SocketOptionName.SendTimeout,
1000 );
///
This will set the send timeout to 1000 milliseconds. Setting the receive
timeout is just as easy ;-)
Remember though, these timeouts have no meaning when using the asynchronous
send/receive methods; they are only of use when using the synchronous
operations.
--
Hope this helps,
Tom Spink