mirror of
https://github.com/wownero/wownero.git
synced 2026-11-12 19:33:54 +01:00
Enable IPv6 support for ZMQ server
This commit is contained in:
@@ -48,6 +48,7 @@ namespace
|
|||||||
constexpr const int num_zmq_threads = 1;
|
constexpr const int num_zmq_threads = 1;
|
||||||
constexpr const std::int64_t max_message_size = 10 * 1024 * 1024; // 10 MiB
|
constexpr const std::int64_t max_message_size = 10 * 1024 * 1024; // 10 MiB
|
||||||
constexpr const std::chrono::seconds linger_timeout{2}; // wait period for pending out messages
|
constexpr const std::chrono::seconds linger_timeout{2}; // wait period for pending out messages
|
||||||
|
constexpr const int ipv6_option = 1;
|
||||||
|
|
||||||
net::zmq::socket init_socket(void* context, int type, epee::span<const std::string> addresses)
|
net::zmq::socket init_socket(void* context, int type, epee::span<const std::string> addresses)
|
||||||
{
|
{
|
||||||
@@ -75,6 +76,12 @@ namespace
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (zmq_setsockopt(out.get(), ZMQ_IPV6, std::addressof(ipv6_option), sizeof(ipv6_option)) != 0)
|
||||||
|
{
|
||||||
|
MONERO_LOG_ZMQ_ERROR("Failed to enable IPv6");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
for (const std::string& address : addresses)
|
for (const std::string& address : addresses)
|
||||||
{
|
{
|
||||||
if (zmq_bind(out.get(), address.c_str()) < 0)
|
if (zmq_bind(out.get(), address.c_str()) < 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user