![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Where a datagram came from, or is going to: an IPv4 host and a port. More...
#include <net_address.h>
Public Member Functions | |
| operator bool () const | |
| True when this names somewhere - a zero address is the null one. | |
| std::string | toString () const |
| "127.0.0.1:27015", for a log line or a readout. | |
Static Public Member Functions | |
| static NetAddress | parse (const std::string &text, uint16_t fallbackPort=0) |
Read "host:port", or "host" with fallbackPort. | |
| static bool | parsePort (const std::string &text, uint16_t &port) |
| Read a port: decimal digits and nothing else, 1 to 65535. | |
Public Attributes | |
| uint32_t | ipv4 = 0 |
| Host byte order: 0x7F000001 is 127.0.0.1. | |
Where a datagram came from, or is going to: an IPv4 host and a port.
Host byte order; converted at the socket.
|
static |
Read "host:port", or "host" with fallbackPort.
A caller passes the project's port as the fallback. A name that is not dotted quad goes through the system resolver.
| text | Host, or host:port. |
| fallbackPort | Used when text carries no port. |
text names nowhere.
|
static |
Read a port: decimal digits and nothing else, 1 to 65535.
Refused whole: "27015x" is not 27015, which they did not ask for.
| text | The digits. |
| port | Set only when text is a port. |
text is not one.