aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpasio.cpp
diff options
context:
space:
mode:
authorZousar Shaker <[email protected]>2021-11-24 00:24:29 -0700
committerZousar Shaker <[email protected]>2021-11-24 00:24:29 -0700
commitdfff6364d4533ebedf1426d2dfc0222c8856b30d (patch)
tree9e6205053c9c9a99f2f757bc97ab564511af1602 /zenhttp/httpasio.cpp
parentFixed unused variable in integration tests. (diff)
downloadzen-dfff6364d4533ebedf1426d2dfc0222c8856b30d.tar.xz
zen-dfff6364d4533ebedf1426d2dfc0222c8856b30d.zip
Changed the asio acceptor initialization to allow dual stack IPV6
connections.
Diffstat (limited to 'zenhttp/httpasio.cpp')
-rw-r--r--zenhttp/httpasio.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp
index 4e4646e3b..d5fe9adbb 100644
--- a/zenhttp/httpasio.cpp
+++ b/zenhttp/httpasio.cpp
@@ -868,8 +868,13 @@ struct HttpAcceptor
HttpAcceptor(HttpAsioServerImpl& Server, asio::io_service& IoService, uint16_t Port)
: m_Server(Server)
, m_IoService(IoService)
- , m_Acceptor(m_IoService, asio::ip::tcp::endpoint(asio::ip::address_v4::any(), Port))
+ , m_Acceptor(m_IoService, asio::ip::tcp::v6())
{
+ m_Acceptor.set_option(asio::ip::v6_only(false));
+ m_Acceptor.set_option(asio::socket_base::reuse_address(true));
+ m_Acceptor.set_option(asio::ip::tcp::no_delay(true));
+ m_Acceptor.bind(asio::ip::tcp::endpoint(asio::ip::address_v6::any(), Port));
+ m_Acceptor.listen();
}
void Start()