Follow

Async test network service verfügbarkeit:

/**
* @param host {string} hostname:port, like localhost:443
* @returns {Promise}
*/
static async _isAvailableNetworkService (host) {
const [hostname, port] = host.split(':', 2)
return new Promise((resolve, reject) => {
const socket = net.connect({ port: port, host: hostname }, () => {
socket.end()
resolve()
})
.on('error', (error) => {
reject(new Error(error))
})
})
}

Bitte um Kritik 😀

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
social.diva.exchange

Willkommen - teile, lerne und erweitere dein Wissen.
Welcome - share, learn and expand your knowledge.
#FOSS #banking #blockchain #DIVA #privacy
+++ Deutsch +++ English +++