bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] setsockopt: Add support for timeouts on W32


From: Bruno Haible
Subject: Re: [PATCH] setsockopt: Add support for timeouts on W32
Date: Thu, 25 Dec 2008 20:59:03 +0100
User-agent: KMail/1.9.9

Hello Martin,

> if a socket is given to
> some external library (e.g. GnuTLS or OpenSSL), I have to convert it 
> using FD_TO_SOCKET() first. It took me some time to figure this out ;)

Yes, this conversion is needed. We wrote something about it in the NEWS file.
Simon wanted to make these conversion functions public in our <sys/socket.h>
replacement, IIRC.

> A small patch to the setsockopt module allows me to set socket timeouts
> (SO_RCVTIMEO and SO_SNDTIMEO) portably. On POSIX systems, a struct
> timeval is used to pass the time information to setsockopt. W32 uses an
> integer that stores the time in milliseconds. The patch below converts
> the struct timeval to milliseconds in the W32-specific setsockopt
> replacement function.

Looks good, thanks.

What about getsockopt()? I would guess it needs to do the opposite
conversion, no?

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]