xgboost
|
Namespaces | |
detail | |
Classes | |
struct | Result |
An error type that's easier to handle than throwing dmlc exception. We can record and propagate the system error code. More... | |
class | SockAddrV6 |
class | SockAddrV4 |
class | SockAddress |
Address for TCP socket, can be either IPv4 or IPv6. More... | |
class | TCPSocket |
TCP socket for simple communication. More... | |
Enumerations | |
enum class | SockDomain : std::int32_t { kV4 = AF_INET , kV6 = AF_INET6 } |
Functions | |
Result | operator+ (Result &&lhs, Result &&rhs) |
auto | Success () noexcept(true) |
Return success. More... | |
auto | Fail (std::string msg, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
Return failure. More... | |
auto | Fail (std::string msg, std::error_code errc, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
Return failure with errno . More... | |
auto | Fail (std::string msg, Result &&prev, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
Return failure with a previous error. More... | |
auto | Fail (std::string msg, std::error_code errc, Result &&prev, char const *file=__builtin_FILE(), std::int32_t line=__builtin_LINE()) |
Return failure with a previous error and a new errno . More... | |
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) |
Parse host address and return a SockAddress instance. Supports IPv4 and IPv6 host. More... | |
Result | Connect (xgboost::StringView host, std::int32_t port, std::int32_t retry, std::chrono::seconds timeout, xgboost::collective::TCPSocket *out_conn) |
Connect to remote address, returns the error code if failed. More... | |
Result | GetHostName (std::string *p_out) |
Get the local host name. More... | |
template<typename H > | |
Result | INetNToP (H const &host, std::string *p_out) |
inet_ntop More... | |
Copyright 2023-2024, XGBoost Contributors
|
strong |
Result xgboost::collective::Connect | ( | xgboost::StringView | host, |
std::int32_t | port, | ||
std::int32_t | retry, | ||
std::chrono::seconds | timeout, | ||
xgboost::collective::TCPSocket * | out_conn | ||
) |
Connect to remote address, returns the error code if failed.
host | Host IP address. |
port | Connection port. |
retry | Number of retries to attempt. |
timeout | Timeout of each connection attempt. |
out_conn | Output socket if the connection is successful. Value is invalid and undefined if the connection failed. |
|
inline |
Return failure.
|
inline |
Return failure with a previous error.
|
inline |
Return failure with errno
.
|
inline |
Return failure with a previous error and a new errno
.
Result xgboost::collective::GetHostName | ( | std::string * | p_out | ) |
Get the local host name.
Result xgboost::collective::INetNToP | ( | H const & | host, |
std::string * | p_out | ||
) |
inet_ntop
SockAddress xgboost::collective::MakeSockAddress | ( | StringView | host, |
in_port_t | port | ||
) |
Parse host address and return a SockAddress instance. Supports IPv4 and IPv6 host.
std::enable_if_t<std::is_invocable_v<Fn>, Result> xgboost::collective::operator<< | ( | Result && | r, |
Fn && | fn | ||
) |
void xgboost::collective::SafeColl | ( | Result const & | rc | ) |
|
inlinenoexcept |
Return success.