Pike v8.0 release 1738

Method NetUtils.ip_and_port_of()


Method ip_and_port_of

array(string) ip_and_port_of(RemoteAddressObject|string|int(0..0) inc, bool|void local_address)

Description

Similar to ip_of. Returns 2-element array containing IP address and port number. Second element will be 0 if no port number can be retrieved.

This function can return 0 if inc is a RemoteAddressObject and query_address throws an error or does not return a string.