QtCraft API C++ classes QML types Handbook

QcServerAddress Struct

A server address as a player types it (decision E-251): "host", "host:port", "1.2.3.4:port", "[v6]:port" or a bare IPv6 address; the port defaults to defaultPort. More...

Header: #include <network/QcServerAddress.h>

Public Functions

QString toString() const

Public Variables

QString host
quint16 port

Static Public Members

const quint16 defaultPort
QcResult<QcServerAddress> parse(const QString &text)

Detailed Description

Member Function Documentation

[static] QcResult<QcServerAddress> QcServerAddress::parse(const QString &text)

Returns the address in text (spaces around it ignored), or the reason it is none.

QString QcServerAddress::toString() const

Returns "host:port", with brackets around IPv6 addresses.

Member Variable Documentation

const quint16 QcServerAddress::defaultPort

The port of an address that names none, also the port a server listens on by default.

QString QcServerAddress::host

The host name or IP address, without brackets.

quint16 QcServerAddress::port

The port.