koi_net.components.port_manager

Classes

PortManager(log, config)

Acquires a port for the NodeServer, looks for free ports if specified one already in use.

class koi_net.components.port_manager.PortManager(log, config)[source]

Bases: object

Acquires a port for the NodeServer, looks for free ports if specified one already in use.

Parameters:
acquire_port()[source]

Attempts to acquire server port defined in config, increments port number if port in use until an open one is found. Config is then updated if new port acquired.

config: ConfigProvider | FullNodeConfig
log: Logger
start()[source]