xgboost
|
命名空间 | |
detail | |
类 | |
结构体 | Result |
一种比抛出 dmlc 异常更容易处理的错误类型。我们可以记录和传播系统错误代码。 更多... | |
类 | SockAddrV6 |
类 | SockAddrV4 |
类 | SockAddress |
TCP socket 地址,可以是 IPv4 或 IPv6。 更多... | |
类 | TCPSocket |
用于简单通信的 TCP socket。 更多... | |
枚举 | |
枚举类 | SockDomain : std::int32_t { kV4 = AF_INET , kV6 = AF_INET6 } |
函数 | |
Result | operator+ (Result &&lhs, Result &&rhs) |
auto | Success () noexcept(true) |
返回成功。 更多... | |
auto | Fail (std::string msg, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
返回失败。 更多... | |
auto | Fail (std::string msg, std::error_code errc, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
返回带有 errno 的失败。 更多... | |
auto | Fail (std::string msg, Result &&prev, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
返回带有先前错误的失败。 更多... | |
auto | Fail (std::string msg, std::error_code errc, Result &&prev, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
返回带有先前错误和新 errno 的失败。 更多... | |
template<typename Fn > | |
std::enable_if_t< std::is_invocable_v< Fn >, Result > | operator<< (Result &&r, Fn &&fn) |
void | SafeColl (Result const &rc) |
SockAddress | MakeSockAddress (StringView host, in_port_t port) |
解析主机地址并返回 SockAddress 实例。支持 IPv4 和 IPv6 主机。 更多... | |
Result | Connect (xgboost::StringView host, std::int32_t port, std::int32_t retry, std::chrono::seconds timeout, xgboost::collective::TCPSocket *out_conn) |
连接到远程地址,失败时返回错误代码。 更多... | |
Result | GetHostName (std::string *p_out) |
获取本地主机名。 更多... | |
template<typename H > | |
Result | INetNToP (H const &host, std::string *p_out) |
inet_ntop 更多... | |
版权所有 2023-2024, XGBoost 贡献者
|
强类型 |
Result xgboost::collective::Connect | ( | xgboost::StringView | host, |
std::int32_t | port, | ||
std::int32_t | retry, | ||
std::chrono::seconds | timeout, | ||
xgboost::collective::TCPSocket * | out_conn | ||
) |
连接到远程地址,失败时返回错误代码。
host | 主机 IP 地址。 |
port | 连接端口。 |
retry | 尝试重试的次数。 |
timeout | 每次连接尝试的超时时间。 |
out_conn | 如果连接成功,则输出 socket。如果连接失败,值 无效且未定义。 |
|
内联 |
返回失败。
|
内联 |
返回带有先前错误的失败。
|
内联 |
返回带有 errno
的失败。
|
内联 |
返回带有先前错误和新 errno
的失败。
Result xgboost::collective::GetHostName | ( | std::string * | p_out | ) |
获取本地主机名。
Result xgboost::collective::INetNToP | ( | H const & | host, |
std::string * | host | ||
) |
inet_ntop
SockAddress xgboost::collective::MakeSockAddress | ( | StringView | host, |
host | in_port_t | ||
) |
port
◆ operator<<() | ( | Result && | std::enable_if_t<std::is_invocable_v<Fn>, Result> xgboost::collective::operator<<, |
r | Fn && | ||
) |
|
auto xgboost::collective::Success |
内联noexcept