Simon Josefsson wrote:
> Maybe something for the 'sockets' module, it is rather Windows specific?

Hmm, I see the 'sockets' module more like the general facilities, that
everyone who uses sockets needs. I would therefore somewhat prefer to see
the declaration of this function in <sys/socket.h> and its implementation
in a separate module.

> +int gl_sockets_from_fd (int fd);

'sockets' in plural? I think 'gl_socket_from_fd' would be better, or
'gl_fd_to_socket'?

The return type should be SOCKET, which is either `unsigned int' or
'unsigned long' (don't know about win64).

Also, it would be good to either have this function return INVALID_SOCKET
if it's not a socket, for robustness - or name the function differently,
to make it clear that the result can be any HANDLE, not necessarily a socket.

Bruno



Reply via email to