tcp-port-used
tcp-port-used copied to clipboard
The library returns wrong status if listener doesn't accept more connection.
In the provided sample if the application using 44201 is not accepting more connections, even the application runs inUse
become false. It's possible to reproduce by coding or using a small TCP socket server and allowing a single connection. When socket is not bound tcpPortUsed
works fine but when listening application stop accepting new connections it thinks socket is not in use. In other words it's checking if a new connection can be made to port but not if the port is in use or not.
var tcpPortUsed = require('tcp-port-used');
tcpPortUsed.check(44201, '127.0.0.1')
.then(function(inUse) {
console.log('Port 44201 usage: '+inUse);
}, function(err) {
console.error('Error on check:', err.message);
});
I'll look into this . Thank you for the report, I'm grateful!