LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line_ports.h File Reference

Host ports of the LINE service containers. More...

#include <cstdio>
#include <exception>
#include <stdexcept>
#include <string>
#include "json.hpp"
#include "line/util/http.h"
Include dependency graph for line_ports.h:

Go to the source code of this file.

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::ports

Functions

int line::ports::allocate (int offset)
 Host port for a given offset within the LINE block.
std::string line::ports::default_url (int port)
 Base URL a service published on port of localhost is reachable at.
std::string line::ports::lqns_default_url ()
 Default LqnsOptions::remote_url.
bool line::ports::is_healthy (const std::string &base)
 True when <base>/api/v1/health answers 2xx.
bool line::ports::is_lqns_service (const std::string &base)
 True when /api/v1/info lists a tool named lqns.
std::string line::ports::resolve_lqns_url (const std::string &configured)
 URL the SolverLQNS remote path posts to, given LqnsOptions::remote_url.

Variables

constexpr int line::ports::BLOCK_FIRST = 29200
 First host port of the reserved block.
constexpr int line::ports::BLOCK_LAST = 29229
 Last host port of the reserved block.
constexpr int line::ports::CONTAINER_PORT = 8080
 Port every service image listens on inside its container.
constexpr int line::ports::LEGACY_PORT = 8080
 Host port every service used before the allocation; a verified fallback only.
constexpr int line::ports::JMT_PORT = BLOCK_FIRST + 1
 imperialqore/jmt-rest.
constexpr int line::ports::LQNS_PORT = BLOCK_FIRST + 2
 imperialqore/line-lqns-rest (lqns, lqsim and qnsolver share the image).
constexpr int line::ports::LDES_PORT = BLOCK_FIRST + 3
 imperialqore/ldes-rest.
constexpr int line::ports::SAGE_PORT = BLOCK_FIRST + 4
 imperialqore/line-sage-rest.

Detailed Description

Host ports of the LINE service containers.

Every imperialqore/ *-rest image listens on 8080 INSIDE its container; that is the image contract and does not change. What is allocated here is the HOST port each service is published on by default, so that two LINE services can run side by side. Mirrors matlab/src/io/line_ports.m, line_solver.api.io.ports and jline.io.LinePorts; the four tables must agree.

The block 29200-29229 is unassigned in the IANA registry, needs no root to bind, and sits BELOW 32768, the floor of the Linux ephemeral range: RFC 6335 points unregistered services at 49152-65535, but that is where operating systems draw outbound source ports from, so a fixed listener there can lose its bind to an outgoing connection, intermittently and only under load.

Offsets are permanent: one is retired, never reused for another tool. Offset 0 is kept free for an aggregating gateway; offsets 5-15 are reserved for the wrapper packages that ship outside this tree.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Definition in file line_ports.h.