desc="Returns an unpacked representation of an IP address encoded by @#net.packip@net.packip@.",
args="$ip$ - the encoded IP address.",
ret=
{
"$ip1$ - the first part of the IP address.",
"$ip2$ - the second part of the IP address.",
"$ip3$ - the third part of the IP address.",
"$ip4$ - the fourth part of the IP address."
}
},
{sig="ip = #net.unpackip#( ip, '*s' )",
desc="Returns an unpacked representation of an IP address encoded by @#net.packip@net.packip@.",
args="$ip$ - the encoded IP address.",
ret="The IP address in string format."
},
{sig="ip = #net.lookup#( hostname )",
desc="Does a DNS lookup.",
args="$hostname$ - the name of the computer.",
ret="The IP address of the computer."
},
{sig="socket = #net.socket#( type )",
desc="Create a socket for TCP/IP communication.",
args=[[$type$ - can be either $net.SOCK_STREAM$ for TCP sockets or $net.SOCK_DGRAM$ for UDP sockets (<span class="warning">not yet supported</span>).]],
ret="The socket that will be used in subsequent operations."
},
{sig="res = #net.close#( socket )",
desc="Close a socket.",
args="$socket$ - the socket to close.",
ret="An error code, as defined @#error_codes@here@."
},
{sig="err = #net.connect#( sock, ip, port )",
desc="Connect a socket to a remote system.",
args=
{
"$sock$ - a socket obtained from @#net.socket@net.socket@.",
"$ip$ - the IP address obtained from @#net.packip@net.packip@.",
"$port$ - the port to connecto to."
},
ret="$err$ - the error code, as defined @#error_codes@here@."
[[$timer_id (optional)$ - the ID of the timer used for measuring the timeout. If not specified it defaults to the @arch_platform_timers.html#the_system_timer@system timer@.]],
[[$timer_id (optional)$ - the ID of the timer used for measuring the timeout. If not specified it defaults to the @arch_platform_timers.html#the_system_timer@system timer@.]],