> For the complete documentation index, see [llms.txt](https://docs.junyangz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.junyangz.com/note/bgnet/ch4.md).

# ch4

1. use `getaddrinfo()` to get all the struct sockaddr info
2. Change `AF_INET` to `AF_INET6`. Change `PF_INET` to `PF_INET6`.
3. Change `INADDR_ANY` assignments to `in6addr_any` assignments
4. Instead of `inet_aton()` or `inet_addr()`,use `inet_pton()`
5. `inet_ntoa()`,use `inet_ntop()`
6. etc...
