|
For the latest stable version, please use Emilua API 0.11! |
ip.get_address_info
Synopsis
local ip = require "ip"
ip.tcp.get_address_info()
ip.tcp.get_address_v4_info()
ip.tcp.get_address_v6_info()
ip.udp.get_address_info()
ip.udp.get_address_v4_info()
ip.udp.get_address_v6_info()
function(host: string|ip.address, service: string|integer[, flags: string[]])
-> { address: ip.address, port: integer, canonical_name: string|nil }[]
Description
Forward-resolves host and service into a list of endpoint entries. Current fiber is suspended until operation finishes.
If no flags are passed to this function (i.e. flags is nil) then
this function will follow the glibc defaults even on non-glibc systems:
bit.bor(address_configured,v4_mapped).
|
Returns a list of entries. Each entry will be a table with the following members:
-
address: ip.address. -
port: integer.
If "canonical_name" is passed in flags then each entry will also include:
-
canonical_name: string.
If host is an ip.address then no host name resolution should be attempted.
If service is a number then no service name resolution should be attempted.
Flags
address_configured
Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.