[Mono-list] Mono 2.8.2/Solaris 10 (Sparc) UDP Socket Send/Receive Timeout Exceptions

Robert Jordan robertj at gmx.net
Thu Feb 10 15:16:38 EST 2011

On 10.02.2011 20:33, rpollestad wrote:
> I recently compiled mono 2.8.2 on both Linux and Solaris 10 and am in the
> process of testing a small UDP client program out (written on Windows).
> The linux install works without issue and reports no errors.
> However, Solaris throws some exceptions when you try to set the SendTimeout
> and ReceiveTimeout socket options:
> Unhandled Exception: System.Net.Sockets.SocketException: Protocol option not
> supported
>    at System.Net.Sockets.Socket.SetSocketOption (SocketOptionLevel
> optionLevel, SocketOptionName optionName, Int32 optionValue) [0x00000] in
> <filename unknown>:0
>    at System.Net.Sockets.Socket.set_SendTimeout (Int32 value) [0x00000] in
> <filename unknown>:0
>    at dhcp_check.Program.Main (System.String[] args) [0x00000] in<filename
> unknown>:0
> The code used is fairly straight-forward and both compilers (mcs or MSVC)
> don't report any errors.
> Socket udpc = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
> ProtocolType.Udp);
> udpc.SendTimeout = 5000;
> udpc.ReceiveTimeout = 5000;
> As mentioned, this runs fine under mono on Linux.
> If I don't set these values, the udp send/receive calls wait forever.
> Is there a reason these might be causing an exception on Solaris only?

Solaris does not support SO_SNDTIMEO and SO_RCVTIMEO, the socket
options behind Send and ReceiveTimeout.

> If I am unable to set them, what other means would be available to do
> something similar?

Use async sockets.


More information about the Mono-list mailing list