1.0.2 • Published 4 years ago

port-pool v1.0.2

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
4 years ago

Port Pool

This module can create a port pool and return the next free port on request. Ports are not reserved at system level. Port will be checked automatically. On every request the full pool is checked again (this means ports will be recycled when they are free again).

Creating a pool

Creating a pool happens in the constructor, like so:

var portPool = new PortPool(5000, 6000);

Requesting a free port

To request a free port simply call the "getNext" function:

portPool.getNext(function(port) {
	// port is the port number
	// port is null when no free port is found
});
1.0.2

4 years ago

1.0.1

8 years ago

1.0.0

8 years ago