port lock

This commit is contained in:
firestar5683
2026-04-13 19:08:49 -05:00
parent 2e7579e25e
commit 9c54dcf26f
45 changed files with 18 additions and 6 deletions
Binary file not shown.
+9 -1
View File
@@ -19,9 +19,17 @@ static size_t fnv1a_hash(const std::string &str) {
return hash_value;
}
static std::string namespaced_endpoint(std::string endpoint) {
const char *namespace_env = std::getenv("OPENPILOT_ZMQ_NAMESPACE");
if (namespace_env != nullptr && namespace_env[0] != '\0') {
endpoint = std::string(namespace_env) + ":" + endpoint;
}
return endpoint;
}
//FIXME: This is a hack to get the port number from the socket name, might have collisions
static int get_port(std::string endpoint) {
size_t hash_value = fnv1a_hash(endpoint);
size_t hash_value = fnv1a_hash(namespaced_endpoint(std::move(endpoint)));
int start_port = 8023;
int max_port = 65535;
int port = start_port + (hash_value % (max_port - start_port));
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
extern const uint8_t gitversion[19];
const uint8_t gitversion[19] = "DEV-77955730-DEBUG";
const uint8_t gitversion[19] = "DEV-2e7579e2-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-77955730-DEBUG
DEV-2e7579e2-DEBUG
+4 -3
View File
@@ -240,9 +240,7 @@ prepare_env() {
export SP_ALLOW_DESKTOP_FAKE_WIFI=0
if [[ "$(uname -s)" == "Darwin" ]] || env_var_truthy "${ZMQ:-0}"; then
if [[ -n "${PREFIX_ARG}" || -n "${OPENPILOT_PREFIX:-}" ]]; then
echo "Ignoring OPENPILOT_PREFIX because the ZMQ backend does not support prefixes." >&2
fi
export OPENPILOT_ZMQ_NAMESPACE="${PREFIX_ARG:-${OPENPILOT_ZMQ_NAMESPACE:-desktop-onroad-$$}}"
unset OPENPILOT_PREFIX
else
export OPENPILOT_PREFIX="${PREFIX_ARG:-${OPENPILOT_PREFIX:-desktop-onroad-$$}}"
@@ -355,6 +353,9 @@ prepare_env
trap cleanup EXIT INT TERM
echo "Using OPENPILOT_PREFIX=${OPENPILOT_PREFIX:-<default>}"
if [[ -n "${OPENPILOT_ZMQ_NAMESPACE:-}" ]]; then
echo "Using OPENPILOT_ZMQ_NAMESPACE=${OPENPILOT_ZMQ_NAMESPACE}"
fi
echo "Preparing replay and desktop UI runtime..."
build_replay
+1
View File
@@ -47,6 +47,7 @@ export PATH="${ROOT_DIR}/.venv/bin:${PATH}"
export PYTHONPATH="${ROOT_DIR}:${ROOT_DIR}/starpilot/third_party"
for d in "${ROOT_DIR}"/*_repo; do [[ -d "$d" ]] && export PYTHONPATH="${PYTHONPATH}:$d"; done
[[ -d "${ROOT_DIR}/third_party/acados" ]] && export PYTHONPATH="${PYTHONPATH}:${ROOT_DIR}/third_party/acados"
export OPENPILOT_ZMQ_NAMESPACE="${OPENPILOT_ZMQ_NAMESPACE:-desktop-c4-$$}"
export BIG=0
export NOBOARD=1
export SIMULATION=1
+1
View File
@@ -220,6 +220,7 @@ prepare_host_artifacts
export PYTHONPATH="${ROOT_DIR}:${ROOT_DIR}/starpilot/third_party"
for d in "${ROOT_DIR}"/*_repo; do [[ -d "$d" ]] && export PYTHONPATH="${PYTHONPATH}:$d"; done
[[ -d "${ROOT_DIR}/third_party/acados" ]] && export PYTHONPATH="${PYTHONPATH}:${ROOT_DIR}/third_party/acados"
export OPENPILOT_ZMQ_NAMESPACE="${OPENPILOT_ZMQ_NAMESPACE:-desktop-c3-$$}"
export SP_DISABLE_AUTO_DEVICE_SCONS=1
scons -j"${jobs}" selfdrive/ui/ui
+1
View File
@@ -47,6 +47,7 @@ export PATH="${ROOT_DIR}/.venv/bin:${PATH}"
export PYTHONPATH="${ROOT_DIR}:${ROOT_DIR}/starpilot/third_party"
for d in "${ROOT_DIR}"/*_repo; do [[ -d "$d" ]] && export PYTHONPATH="${PYTHONPATH}:$d"; done
[[ -d "${ROOT_DIR}/third_party/acados" ]] && export PYTHONPATH="${PYTHONPATH}:${ROOT_DIR}/third_party/acados"
export OPENPILOT_ZMQ_NAMESPACE="${OPENPILOT_ZMQ_NAMESPACE:-desktop-raybig-$$}"
export BIG=1
export NOBOARD=1
export SIMULATION=1
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.