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