mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Don't hardcode broadcast port.
This commit is contained in:
parent
1b3b3a94a2
commit
de058d2a0d
@ -1152,7 +1152,7 @@ void Profiler::Worker()
|
||||
if( t - m_lastBroadcast > 5000000000 ) // 5s
|
||||
{
|
||||
m_lastBroadcast = t;
|
||||
m_broadcast->Send( broadcastMsg, broadcastLen );
|
||||
m_broadcast->Send( 8087, broadcastMsg, broadcastLen );
|
||||
auto err = WSAGetLastError();
|
||||
}
|
||||
}
|
||||
|
@ -413,12 +413,12 @@ void UdpBroadcast::Close()
|
||||
m_sock = -1;
|
||||
}
|
||||
|
||||
int UdpBroadcast::Send( const void* data, int len )
|
||||
int UdpBroadcast::Send( int port, const void* data, int len )
|
||||
{
|
||||
assert( m_sock != -1 );
|
||||
struct sockaddr_in addr;
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons( 8087 );
|
||||
addr.sin_port = htons( port );
|
||||
addr.sin_addr.s_addr = INADDR_BROADCAST;
|
||||
return sendto( m_sock, (const char*)data, len, MSG_NOSIGNAL, (sockaddr*)&addr, sizeof( addr ) );
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
bool Open( const char* addr, const char* port );
|
||||
void Close();
|
||||
|
||||
int Send( const void* data, int len );
|
||||
int Send( int port, const void* data, int len );
|
||||
|
||||
UdpBroadcast( const UdpBroadcast& ) = delete;
|
||||
UdpBroadcast( UdpBroadcast&& ) = delete;
|
||||
|
Loading…
Reference in New Issue
Block a user