You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a connection fails, the socket error was being incorrectly reported
as an address family not supported error, instead of connection refused.
It looks like this happened between
c4e698c (Unity 2018.1b5), where the
proper error was reported, and ec98a4e
(Unity 2018.1b6), there the incorrect error is reported.
Why did this happen? Between those two changesets (there are about 180
intervening changesets), the order of addresses returned from
`Dns.GetHostAddresses` changed. The newer code returns the IPv6 address
first, and the IPv4 address second. While `GetCheckedIPs` mentioned in a
comment that it skips addresses that don't match the address family, it
did not. The code using the addresses returned by `GetCheckedIPs` will
use the first address in the array. If this address happens to match the
address family of the socket, things will work "properly" (the correct
socket error will occur).
If, however the first entry has the wrong address family, then the
socket error will be an address family not supported error, since the
socket was created with different address family.
This change modifies `GetCheckedIPs` to filter the addresses, removing
those which do not match the address family.
This corrects Unity case 1012875.
0 commit comments