1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

Fixed problem with setting correct local address when we change DualStack property. Do not use any IPv6 features by default.

This commit is contained in:
Badartefact
2019-06-14 22:39:29 +03:00
parent 37cd6ac2c3
commit b9bfbb0be5
3 changed files with 14 additions and 5 deletions

View File

@@ -135,7 +135,11 @@ namespace Lidgren.Network
if(m_configuration.DualStack && m_configuration.LocalAddress.AddressFamily == AddressFamily.InterNetworkV6)
m_socket.DualMode = true;
var ep = (EndPoint)new NetEndPoint(m_configuration.LocalAddress.MapToIPv6(), reBind ? m_listenPort : m_configuration.Port);
var localAddress = m_configuration.DualStack
? m_configuration.LocalAddress.MapToIPv6()
: m_configuration.LocalAddress;
var ep = (EndPoint)new NetEndPoint(localAddress, reBind ? m_listenPort : m_configuration.Port);
m_socket.Bind(ep);
try