wilton/net
Networking operations.
More...
Functions | |
Array | resolveHostname (Object options, Function|Undefined callback) |
Find IP address for the specified hostname. | |
Undefined | waitForTcpConnection (Object options, Function|Undefined callback) |
Wait for the remote TCP endpoint to become accessible. |
This module provide a number of networking oprerations, auxilary to the networking sockets API provided by wilton/Socket
module.
Usage example:
Array net::resolveHostname | ( | Object | options, |
Function|Undefined | callback | ||
) |
Finds the list of IPv4 addresses for the specified hostname. If call exits without exception, the returned list of IP addresses is always non-empty.
options | Object configuration object, see possible options below |
callback | Function|Undefined callback to receive result or error |
Array
list of IP addressesOptions
String
hostname to resolveNumber
max wait time, in milliseconds Undefined net::waitForTcpConnection | ( | Object | options, |
Function|Undefined | callback | ||
) |
Tries to connect to the specified TCP endpoint. Throws Error
on timeout.
Intended to be used to check the state of the started HTTP server in spawned process.
options | Object configuration object, see possible options below |
callback | Function|Undefined callback to receive result or error |
Undefined
Options
String
IPv4 network addressNumber
TCP portNumber
max wait time, in milliseconds