mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Send listen port in broadcast message.
This commit is contained in:
parent
14c896573d
commit
127224acc6
@ -526,12 +526,13 @@ static uint64_t GetPid()
|
||||
#endif
|
||||
}
|
||||
|
||||
static BroadcastMessage& GetBroadcastMessage( const char* procname, size_t pnsz, int& len )
|
||||
static BroadcastMessage& GetBroadcastMessage( const char* procname, size_t pnsz, int& len, int port )
|
||||
{
|
||||
static BroadcastMessage msg;
|
||||
|
||||
msg.broadcastVersion = BroadcastVersion;
|
||||
msg.protocolVersion = ProtocolVersion;
|
||||
msg.listenPort = port;
|
||||
|
||||
memcpy( msg.programName, procname, pnsz );
|
||||
memset( msg.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );
|
||||
@ -1247,7 +1248,7 @@ void Profiler::Worker()
|
||||
#endif
|
||||
|
||||
int broadcastLen = 0;
|
||||
auto& broadcastMsg = GetBroadcastMessage( procname, pnsz, broadcastLen );
|
||||
auto& broadcastMsg = GetBroadcastMessage( procname, pnsz, broadcastLen, dataPort );
|
||||
uint64_t lastBroadcast = 0;
|
||||
|
||||
// Connections loop.
|
||||
|
@ -10,7 +10,7 @@ namespace tracy
|
||||
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
|
||||
|
||||
enum : uint32_t { ProtocolVersion = 28 };
|
||||
enum : uint32_t { BroadcastVersion = 0 };
|
||||
enum : uint32_t { BroadcastVersion = 1 };
|
||||
|
||||
using lz4sz_t = uint32_t;
|
||||
|
||||
@ -92,6 +92,7 @@ struct BroadcastMessage
|
||||
{
|
||||
uint32_t broadcastVersion;
|
||||
uint32_t protocolVersion;
|
||||
uint32_t listenPort;
|
||||
uint32_t activeTime; // in seconds
|
||||
char programName[WelcomeMessageProgramNameSize];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user