1#ifndef ASTEROIDS_NET_PORT_MAPPING_HPP
2#define ASTEROIDS_NET_PORT_MAPPING_HPP
33 void open(
const std::string &port);
35 [[nodiscard]]
const std::string &
status()
const;
44 Method method = Method::None;
45 std::uint16_t private_port = 0;
46 std::uint16_t public_port = 0;
47 std::string status_message =
"Automatic router mapping unavailable; forward the UDP port manually.";
PortMapping(const PortMapping &)=delete
~PortMapping()
Removes the active mapping, if one was created.
void open(const std::string &port)
Attempts to expose a local UDP port through the router.
PortMapping & operator=(const PortMapping &)=delete
const std::string & status() const
Returns a human-readable description of the mapping result.
PortMapping()=default
Creates an inactive port mapping.