1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Broadcast to localhost if listening only on localhost.

This commit is contained in:
Bartosz Taudul 2020-12-16 15:24:33 +01:00
parent 6f83044cf6
commit 2049332211
2 changed files with 7 additions and 2 deletions

View File

@ -1358,7 +1358,12 @@ void Profiler::Worker()
#ifndef TRACY_NO_BROADCAST
m_broadcast = (UdpBroadcast*)tracy_malloc( sizeof( UdpBroadcast ) );
new(m_broadcast) UdpBroadcast();
if( !m_broadcast->Open( "255.255.255.255", broadcastPort ) )
# ifdef TRACY_ONLY_LOCALHOST
const char* addr = "127.255.255.255";
# else
const char* addr = "255.255.255.255";
# endif
if( !m_broadcast->Open( addr, broadcastPort ) )
{
m_broadcast->~UdpBroadcast();
tracy_free( m_broadcast );

View File

@ -603,7 +603,7 @@ bool UdpBroadcast::Open( const char* addr, uint16_t port )
if( !ptr ) return false;
m_sock = sock;
m_addr = inet_addr( addr );
inet_pton( AF_INET, addr, &m_addr );
return true;
}