tiran / socketfromfd

Python module to create a socket from a file descriptor with auto-detection
Apache License 2.0
6 stars 0 forks source link

Keepfd arg is backwards #1

Open Posnet opened 6 years ago

Posnet commented 6 years ago

The keepfd arg is backwards for the python3 implementaion:

if keep_fd:
            return socket.fromfd(fd, family, typ, proto)
else:
            return socket.socket(family, typ, proto, fileno=fd)

see: socket

... Unlike socket.fromfd(), fileno will return the same socket and not a duplicate ...

fromfd

Duplicate the file descriptor fd (an integer as returned by a file object’s fileno() method) and build a socket object ...

apollo13 commented 6 years ago

@tiran you wanted to get nagged