examples/network: Support IPv4 and IPv6 in HTTP client examples.
The main changes here are to pass the address family and socket type to
`getaddrinfo()`, and then use the result of the address lookup when
creating the socket, so it has the correct address family.
This allows both IPv4 and IPv6 to work, because the socket is created with
the correct AF_INETx type for the address.
Also add some more comments to the examples to explain what's going on.
Fixes issue #15580.
Signed-off-by: Damien George <damien@micropython.org>
Showing
Please register or sign in to comment