SnmpKit.SnmpSim.TestHelpers.PortAllocator (snmpkit v0.6.3)
Simple port allocation service for tests.
Manages a pool of available ports and allocates them on demand. Ports can be reserved and released for reuse.
Summary
Functions
Legacy function for backward compatibility. Allocates a port range for a specific test type.
Returns a specification to start this module under a supervisor.
Get allocation statistics.
Release a single port back to the pool.
Release a port range back to the pool.
Reserve a single port. Returns {:ok, port} or {:error, reason}
Reserve a range of ports. Returns {:ok, {start_port, end_port}} or {:error, reason}
Reset all allocations.
Start the port allocator service.
Functions
Legacy function for backward compatibility. Allocates a port range for a specific test type.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Get allocation statistics.
Release a single port back to the pool.
Release a port range back to the pool.
Reserve a single port. Returns {:ok, port} or {:error, reason}
Reserve a range of ports. Returns {:ok, {start_port, end_port}} or {:error, reason}
Reset all allocations.
Start the port allocator service.