utils
sleap.gui.utils
¶
Generic module containing utilities used for the GUI.
Functions:
| Name | Description |
|---|---|
find_free_port |
Find free port to bind to. |
is_port_free |
Checks if a port is free. |
select_zmq_port |
Select a port that is free to connect within the given context. |
find_free_port(port, zmq_context)
¶
Find free port to bind to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
The port to start searching from. |
required |
zmq_context
|
Context
|
The ZMQ context to use. |
required |
Returns:
| Type | Description |
|---|---|
|
The free port. |
Source code in sleap/gui/utils.py
is_port_free(port, zmq_context=None)
¶
Checks if a port is free.
Source code in sleap/gui/utils.py
select_zmq_port(zmq_context=None)
¶
Select a port that is free to connect within the given context.