Add TRACY_ONLY_LOCALHOST macro to avoid listening on all interfaces.

This commit is contained in:
Graydon Hoare 2020-05-28 22:09:59 -07:00
parent ce0d8d9fb7
commit e76b8ae423
No known key found for this signature in database
GPG Key ID: 69824B014EE65219
2 changed files with 6 additions and 0 deletions

View File

@ -393,7 +393,9 @@ bool ListenSocket::Listen( int port, int backlog )
memset( &hints, 0, sizeof( hints ) );
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_STREAM;
#ifndef TRACY_ONLY_LOCALHOST
hints.ai_flags = AI_PASSIVE;
#endif
char portbuf[32];
sprintf( portbuf, "%i", port );

View File

@ -406,6 +406,10 @@ The client with on-demand profiling enabled needs to perform additional bookkeep
By default Tracy client will announce its presence to the local network\footnote{Additional configuration may be required to achieve full functionality, depending on your network layout. Read about UDP broadcasts for more information.}. If you want to disable this feature, define the \texttt{TRACY\_NO\_BROADCAST} macro.
\subsubsection{Client network interface}
By default Tracy client will listen on all network interfaces. If you want to restrict it to only listening on the localhost interface, define the \texttt{TRACY\_ONLY\_LOCALHOST} macro.
\subsubsection{Setup for multi-DLL projects}
In projects that consist of multiple DLLs/shared objects things are a bit different. Compiling \texttt{TracyClient.cpp} into every DLL is not an option because this would result in several instances of Tracy objects lying around in the process. We rather need to pass the instances of them to the different DLLs to be reused there.