timeout switch for actsync

Alexander Bartolich alexander.bartolich at gmx.at
Thu Jul 7 01:25:16 UTC 2011


Florian Schlichting wrote:
> Hi Julien,
>> [...]
>> Is it really portable?
>> I doubt SO_RCVTIMEO and SO_SNDTIMEO are defined on all platforms.
>
> I have no experience at all when it comes to porting and portability.
> Would anyone happen to know good resources on this topic in general?

SO_RCVTIMEO and SO_SNDTIMEO are defined by POSIX.
But not all platforms follow the standard to this degree.
Money quote:

http://pubs.opengroup.org/onlinepubs/009695399/functions/setsockopt.html
# [...]
# Note that not all implementations allow this option to be set.

On Ubuntu, "man 7 socket" says that SO_RCVTIMEO and SO_SNDTIMEO are
supported since Linux 2.3.41, i.e. it was introduced somewhere around
the year 2000. I guess that some vendors of closed-source Unix did not
bother to update their OS since then.

If you want a really portable solution there is O_NONBLOCK.
It requires non-trivial changes to the code, however.

Ciao

     Alexander.



More information about the inn-workers mailing list