You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sockets: fix getipaddr/getipaddrs documentation, add islinklocaladdr function (#34300)
* fix getipaddr/getipaddrs documentation
- resolved IPv4/IPv6 confusion, e.g. getipaddrs() does _not_ return only IPv4
- more realistic example addresses
- example addresses taken from address ranges reserved for documentation
https://en.wikipedia.org/wiki/Reserved_IP_addresses
* add Sockets.islinklocaladdr
IPv6 interfaces always have a link-local address configured, which is
also reported by getipaddrs(). However, typical application servers
are not reachable under their link-local address, therefore this
convenience function helps users of getipaddrs() to filter
out such addresses with `filter(!islinklocaladdr, getipaddrs())`.
This commits also adds a "See also" hint that in applications where
a server process has been started remotely via ssh that
`split(ENV["SSH_CONNECTION"], ' ')[3]` can be a preferable
alternative source for the IP address under which this server
is reachable (namely the address that ssh has already used
successfully to get here).
0 commit comments