mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
#1251 - add ipv6 address preference for NTCP/2, NTCP2 code clean
This commit is contained in:
parent
7c7742a175
commit
7ab29950a4
3 changed files with 170 additions and 153 deletions
|
@ -50,14 +50,14 @@ namespace transport
|
|||
void SSUServer::OpenSocketV6 ()
|
||||
{
|
||||
try {
|
||||
m_SocketV6.open (boost::asio::ip::udp::v6());
|
||||
m_SocketV6.open (boost::asio::ip::udp::v6 ());
|
||||
m_SocketV6.set_option (boost::asio::ip::v6_only (true));
|
||||
m_SocketV6.set_option (boost::asio::socket_base::receive_buffer_size (SSU_SOCKET_RECEIVE_BUFFER_SIZE));
|
||||
m_SocketV6.set_option (boost::asio::socket_base::send_buffer_size (SSU_SOCKET_SEND_BUFFER_SIZE));
|
||||
#ifndef WIN32
|
||||
// Set preference to use public IPv6 address -- works only on linux
|
||||
typedef boost::asio::detail::socket_option::boolean<IPV6_ADDR_PREFERENCES, IPV6_PREFER_SRC_PUBLIC> ipv6PreferPubAddr;
|
||||
m_SocketV6.set_option (ipv6PreferPubAddr(true));
|
||||
m_SocketV6.set_option (ipv6PreferPubAddr (true));
|
||||
#endif
|
||||
m_SocketV6.bind (m_EndpointV6);
|
||||
LogPrint (eLogInfo, "SSU: Start listening v6 port ", m_EndpointV6.port());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue