Closed ddimtirov closed 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.
Ports
class, which orchestrates block allocation.Ports.Exporter
extension point. This can also be used to probe an allocated port and fail early if not available.Ports.Registrar
extension point. 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.
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.