BSD Ports

net/py-ephemeral_port_reserve 1.1.4 NetBSD

Bind to ephemeral port, force it into TIME_WAIT state, and unbind it

System
NetBSD
Repository
pkgsrc
Maintainer
[email protected]
License
mit
Categories
net, python
Package size
7.6 KiB, 12.7 KiB installed

Description

Sometimes you need a networked program to bind to a port that can't be hard-coded. Generally this is when you want to run several of them in parallel; if they all bind to port 8080, only one of them can succeed.

The usual solution is the "port 0 trick". If you bind to port 0, your kernel will find some arbitrary high-numbered port that's unused and bind to that. Afterward you can query the actual port that was bound to if you need to use the port number elsewhere. However, there are cases where the port 0 trick won't work. For example, mysqld takes port 0 to mean "the port configured in my.cnf". Docker can bind your containers to port 0, but uses its own implementation to find a free port which races and fails in the face of parallelism.

ephemeral-port-reserve provides an implementation of the port 0 trick which is reliable and race-free.

In the other systems

The newest version among them is 1.1.4, as upstream numbers it.

SystemPortVersionVulnerabilitiesStatusMaintainerLast update
NetBSDnet/py-ephemeral_port_reserve1.1.4 newestnone known-[email protected]-
OpenBSDnet/py-ephemeral_port_reserve1.1.4p2 newestno data-The OpenBSD ports mailing-list <[email protected]>-

Compare across BSDs

Install

Binary package:

pkgin install py311-ephemeral_port_reserve

From pkgsrc:

cd /usr/pkgsrc/net/py-ephemeral_port_reserve && make install clean

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

RepositoryVersion
NetBSD 10.1 x86_641.1.4
NetBSD 10.1 aarch641.1.4
SmartOS / illumos x86_641.1.4
macOS 15 arm641.1.4

Dependency graph

Ports that need it on the left, what it needs to run on the right; at most 8 of each. "Dependencies" below lists them all.

Dependencies

Run dependencies 1

No port depends on this one.

Configuration

No options to configure.

Service scripts
none
Flavors
py312-ephemeral_port_reserve-1.1.4, py313-ephemeral_port_reserve-1.1.4, py314-ephemeral_port_reserve-1.1.4