SnmpKit.SnmpSim.TestHelpers.PortHelper (snmpkit v0.6.3)

Simple helper functions for port allocation in tests.

Summary

Functions

Get a port for testing, ensuring PortAllocator is started. Falls back to server port range if PortAllocator fails.

Get a range of ports for testing.

Release a port back to the pool.

Release a port range back to the pool.

Functions

get_port()

Get a port for testing, ensuring PortAllocator is started. Falls back to server port range if PortAllocator fails.

get_port_range(count)

Get a range of ports for testing.

release_port(port)

Release a port back to the pool.

release_port_range(start_port, end_port)

Release a port range back to the pool.