Bind only on IPv4, if restricted to localhost.

This is needed, as disabling the IPV6_V6ONLY socket option doesn't work for
localhost listeners on Windows.
This commit is contained in:
Bartosz Taudul 2020-12-16 15:33:05 +01:00
parent 2049332211
commit 025ab1626b

View File

@ -474,7 +474,7 @@ bool ListenSocket::Listen( uint16_t port, int backlog )
struct addrinfo* res = nullptr;
#ifndef TRACY_ONLY_IPV4
#if !defined TRACY_ONLY_IPV4 && !defined TRACY_ONLY_LOCALHOST
const char* onlyIPv4 = getenv( "TRACY_ONLY_IPV4" );
if( !onlyIPv4 || onlyIPv4[0] != '1' )
{