[Mono-list] Fail to set socket send&receive timeout!

Dick Porter dick at ximian.com
Thu Dec 22 08:28:22 EST 2005


On Thu, 2005-12-22 at 04:40 +0100, Gonzalo Paniagua Javier wrote:
> > 			//following 2 functions cause a exception:non-block socket would block
> > 			TCPSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.SendTimeout,1000);
> > 			TCPSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.ReceiveTimeout,1000);
> 
> You have to Connect() or Accept() before setting the timeout.

I don't think that's true - the timeout will apply to the Accept () too.
Unless you mean that that's the correct way to apply the timeout in a
manner that results in working code, then you're probably correct.

- Dick




More information about the Mono-list mailing list