Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, timeout);
If timeout is set to -1, then the method works fine on Windows, but fails on Linux & Mac with the following exception
System.Net.Sockets.SocketException (22): Invalid argument at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue, Boolean silent) at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Int32 optionValue)
If timeout is set to 0 on mac and linux, there is no exception.
1) if timeout is set to -1 it does a indefinite poll on windows. Will timeout=0 do the same on windows?
2) ON linux if timeout is set to 0? Does it do a indefinite poll?
When i use 0 for timeout then the application intermittently fails with
System.NotSupportedException: The BeginWrite method cannot be called >when another write operation is pending. at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, >Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.BeginWrite(Byte[] buffer, Int32 >offset, Int32 count, AsyncCallback asyncCallback, Object asyncState)