faio
faio 公共 C++ 接口参考
载入中...
搜索中...
未找到
faio::net::HostPort类 参考

用于主机名解析的 host/service 参数值。 更多...

Public 成员函数

 HostPort (std::string_view hostname, std::uint16_t port)
 构造HostPort对象。
 HostPort (std::string_view hostname, std::string_view service_name)
 构造HostPort对象。

Public 属性

std::string host
 主机名或数字 IP;按值保存。
std::string service
 服务名或端口的字符串形式。

详细描述

用于主机名解析的 host/service 参数值。

公共头文件
#include <faio/net/address.hpp>

构造及析构函数说明

◆ HostPort() [1/2]

faio::net::HostPort::HostPort ( std::string_view hostname,
std::uint16_t port )

构造HostPort对象。

参数
hostname主机名或数字 IP,复制保存到对象。
port网络端口号,取值范围由 uint16_t 限定。
返回值
构造函数不返回值。
注解
对象的复制、移动和资源所有权遵循类型说明。

◆ HostPort() [2/2]

faio::net::HostPort::HostPort ( std::string_view hostname,
std::string_view service_name )

构造HostPort对象。

参数
hostname主机名或数字 IP,复制保存到对象。
service_name服务名或端口字符串,复制保存到对象。
返回值
构造函数不返回值。
注解
对象的复制、移动和资源所有权遵循类型说明。