CAPAUT-254 Add udp tests and node mock

This commit is contained in:
2022-07-28 21:28:25 +02:00
parent 110f7a9ad8
commit 1114518ff3
3 changed files with 46 additions and 5 deletions

View File

@@ -48,13 +48,13 @@ module.exports = function(RED) {
const address = udpServer.address()
node.status({ fill: 'green', shape: 'dot', text: `Server is listening: ${address.address}:${address.port}` })
})
udpServer.bind(config.listenPort || PARADIGMA_UDP_PORT_DEFAULT)
udpServer.bind(config.listenPort || PARADIGMA_UDP_PORT_DEFAULT)
// Cleanup hooks
node.on('close', () => {
if ( udpServer ) {
udpServer.close()
}
})
})
}
/**