Module NetUtils

Description

Various networking-related utility functions.


Constant locality

constant NetUtils.locality

Description

Mapping from NetworkType to an integer between 0 and 10 that describes how local that type of network is.


Variable ANY

string|zero NetUtils.ANY

Description

Returns either 0 or "::" depending on whether or not this computer has IPv6 support.

The intent is to use this when binding addresses, like port->bind(portno,callback,NetUtils.ANY) to get ipv6 support if present.

The reason for the existence of this function is that using "::" on a computer that does not actually have any ipv6 addresses (and thus no support for ipv6), at least on linux, causes the bind call to fail entirely.

Note

Read only