diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/messagebus/coreconn.cpp | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/messagebus/coreconn.cpp')
-rw-r--r-- | library/cpp/messagebus/coreconn.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/library/cpp/messagebus/coreconn.cpp b/library/cpp/messagebus/coreconn.cpp new file mode 100644 index 0000000000..d9411bb5db --- /dev/null +++ b/library/cpp/messagebus/coreconn.cpp @@ -0,0 +1,30 @@ +#include "coreconn.h" + +#include "remote_connection.h" + +#include <util/datetime/base.h> +#include <util/generic/yexception.h> +#include <util/network/socket.h> +#include <util/string/util.h> +#include <util/system/thread.h> + +namespace NBus { + TBusInstant Now() { + return millisec(); + } + + EIpVersion MakeIpVersion(bool allowIpv4, bool allowIpv6) { + if (allowIpv4) { + if (allowIpv6) { + return EIP_VERSION_ANY; + } else { + return EIP_VERSION_4; + } + } else if (allowIpv6) { + return EIP_VERSION_6; + } + + ythrow yexception() << "Neither of IPv4/IPv6 is allowed."; + } + +} |