Function ros2_medkit_gateway::parse_url_host_port

Function Documentation

inline std::pair<std::string, int> ros2_medkit_gateway::parse_url_host_port(const std::string &url)

Parse host and port from a URL of the form “scheme://host:port[/path]”.

Handles IPv6 bracket notation (e.g. “http://[::1]:8080/api”).

Parameters:

url – Full URL string

Returns:

Pair of {host, port}. Returns {“”, -1} if parsing fails entirely. Returns {host, -1} if port is missing.