Closed fvigo closed 2 years ago
There is no support for IPv6 at the moment, feel free to help.
For this I will definitely need to fix the CI before merging to master
, though, but still no answers from Travis...
Have you considered trying GitHub actions?
Yes, that would be the alternative. Edit: DONE!
Hi @fvigo, were you thinking to propose a PR related to this issue? Otherwise I'll have a look at it in the near future.
Hi @mindflayer , sorry for the delayed response. I found a solution that allowed me to continue without requiring a change to mocket
.
For IPV6 support, I think should be considered an enhancement, but the issues described here might create problems with the socket API.
They should be both easy fixes: allow MocketSocket.connect() to support tuples of 4 elements, and rename socktype to type in getaddrinfo. However, I'd recommend for you to take a look at those as, especially the latter, might maybe break some compatibility.
Describe the bug When using mocked sockets in some conditions, certain socket properties are not properly implemented.
address
can be a tuple of four elements (see https://docs.python.org/3/library/socket.html#socket-families ), but the current implementation only takes tuples with 2 arguments. For examplesocket.connect((host, port, 0, 0))
should not throw an error.getaddrinfo()
is calledtype
( https://docs.python.org/3/library/socket.html#socket.getaddrinfo ) and notsocktype
as implemented here: https://github.com/mindflayer/python-mocket/blob/bce7cde62177bb23008ff57c84faaca1294b645d/mocket/mocket.py#L458