dns.lookupService()

dns.lookupService(address, port, callback) Resolves the given address and port into a hostname and service using the operating system's underlying getnameinfo implementation. The callback has arguments (err, hostname, service). The hostname and service arguments are strings (e.g. 'localhost' and 'http' respectively). On error, err is an Error object, where err.code is the error code. const dns = require('dns'); dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { console.log

dns.lookup()

dns.lookup() Under the hood, dns.lookup() uses the same operating system facilities as most other programs. For instance, dns.lookup() will almost always resolve a given name the same way as the ping command. On most POSIX-like operating systems, the behavior of the dns.lookup() function can be modified by changing settings in nsswitch.conf(5) and/or resolv.conf(5), but note that changing these files will change the behavior of all other programs running on the same operating system. Though t

dns.getServers()

dns.getServers() Returns an array of IP address strings that are being used for name resolution.

disconnect event (Cluster)

Event: 'disconnect' worker <cluster.Worker> Emitted after the worker IPC channel has disconnected. This can occur when a worker exits gracefully, is killed, or is disconnected manually (such as with worker.disconnect()). There may be a delay between the 'disconnect' and 'exit' events. These events can be used to detect if the process is stuck in a cleanup or if there are long-living connections. cluster.on('disconnect', (worker) => { console.log(`The worker #${worker.id} has di

disconnect event (Worker)

Event: 'disconnect' Similar to the cluster.on('disconnect') event, but specific to this worker. cluster.fork().on('disconnect', () => { // Worker has disconnected });

disconnect event (ChildProcess)

Event: 'disconnect' The 'disconnect' event is emitted after calling the ChildProcess.disconnect() method in the parent or child process. After disconnecting it is no longer possible to send or receive messages, and the ChildProcess.connected property is false.

diffieHellman.verifyError

diffieHellman.verifyError A bit field containing any warnings and/or errors resulting from a check performed during initialization of the DiffieHellman object. The following values are valid for this property (as defined in constants module): DH_CHECK_P_NOT_SAFE_PRIME DH_CHECK_P_NOT_PRIME DH_UNABLE_TO_CHECK_GENERATOR DH_NOT_SUITABLE_GENERATOR

diffieHellman.setPublicKey()

diffieHellman.setPublicKey(public_key[, encoding]) Sets the Diffie-Hellman public key. If the encoding argument is provided and is either 'binary', 'hex' or 'base64', public_key is expected to be a string. If no encoding is provided, public_key is expected to be a Buffer.

diffieHellman.setPrivateKey()

diffieHellman.setPrivateKey(private_key[, encoding]) Sets the Diffie-Hellman private key. If the encoding argument is provided and is either 'binary', 'hex', or 'base64', private_key is expected to be a string. If no encoding is provided, private_key is expected to be a Buffer.

diffieHellman.getPrivateKey()

diffieHellman.getPrivateKey([encoding]) Returns the Diffie-Hellman private key in the specified encoding, which can be 'binary', 'hex', or 'base64'. If encoding is provided a string is returned; otherwise a Buffer is returned.