ddimtirov / nuggets

nuggets is (yet another) utility library for Java
https://ddimtirov.github.io/nuggets/javadoc/io/github/ddimitrov/nuggets/package-summary.html
Apache License 2.0
4 stars 1 forks source link

Port Allocator #39

Closed ddimtirov closed 7 years ago

ddimtirov commented 7 years ago
ddimtirov commented 7 years ago

After analysis, block port reservation is identified to be the main use-case, while the rest of the initial scope boils down to exposing the allocated ports, and controlling the process of allocation. We chose not to support non-block allocations (i.e. keeping track of where "bind to port 0" ended up.

Registrars can also be exporters, but hey need to be registered for each hook separately. Both can implement AutoCloseable and will be notified appropriately when the Ports instance is closed.

ddimtirov commented 7 years ago

Bonjour/mDNS can be accomodated as custom registrars.

I can't think right now of generic way to support UDP network/port allocation. Ignoring this requirement - if it comes back later will raise another ticket.