Skip to content

Commit 85a10f2

Browse files
authored
Merge pull request wolfpld#35 from graydon/localhost-only
Add TRACY_ONLY_LOCALHOST macro to avoid listening on all interfaces.
2 parents ce0d8d9 + e76b8ae commit 85a10f2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎common/TracySocket.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ bool ListenSocket::Listen( int port, int backlog )
393393
memset( &hints, 0, sizeof( hints ) );
394394
hints.ai_family = AF_INET6;
395395
hints.ai_socktype = SOCK_STREAM;
396+
#ifndef TRACY_ONLY_LOCALHOST
396397
hints.ai_flags = AI_PASSIVE;
398+
#endif
397399

398400
char portbuf[32];
399401
sprintf( portbuf, "%i", port );

‎manual/tracy.tex‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ \subsubsection{Client discovery}
406406

407407
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.
408408

409+
\subsubsection{Client network interface}
410+
411+
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.
412+
409413
\subsubsection{Setup for multi-DLL projects}
410414

411415
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.

0 commit comments

Comments
 (0)