Skip to content

Commit

Permalink
Changing default port (macOS uses 8086 for something else)
Browse files Browse the repository at this point in the history
  • Loading branch information
slomp committed Sep 21, 2023
1 parent 83b52d9 commit 2885772
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion capture/src/capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int main( int argc, char** argv )
bool overwrite = false;
const char* address = "127.0.0.1";
const char* output = nullptr;
int port = 8086;
int port = 8087;
int seconds = -1;

int c;
Expand Down
2 changes: 1 addition & 1 deletion manual/techdoc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ \subsection{Worker loop}

\subsubsection{Establishing connection}

Profiler waits for an incoming TCP connections on port 8086. To advertise that a client is available, an UDP broadcast (\texttt{BroadcastMessage}) is being sent on the same port.
Profiler waits for an incoming TCP connections on port 8087. To advertise that a client is available, an UDP broadcast (\texttt{BroadcastMessage}) is being sent on the same port.

Each iteration of the main connection loop handles the whole connection. Multiple iterations are only possible if the on-demand mode is enabled, or if the initial handshake is not successful.

Expand Down
4 changes: 2 additions & 2 deletions manual/tracy.tex
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ \subsubsection{Problematic platforms}

\subsubsection{Changing network port}

By default, the client and server communicate on the network using port 8086. The profiling session utilizes the TCP protocol, and the client sends presence announcement broadcasts over UDP.
By default, the client and server communicate on the network using port 8087. The profiling session utilizes the TCP protocol, and the client sends presence announcement broadcasts over UDP.

Suppose for some reason you want to use another port\footnote{For example, other programs may already be using it, or you may have overzealous firewall rules, or you may want to run two clients on the same IP address.}. In that case, you can change it using the \texttt{TRACY\_DATA\_PORT} macro for the data connection and \texttt{TRACY\_BROADCAST\_PORT} macro for client broadcasts. Alternatively, you may change both ports at the same time by declaring the \texttt{TRACY\_PORT} macro (specific macros listed before have higher priority). You may also change the data connection port without recompiling the client application by setting the \texttt{TRACY\_PORT} environment variable.

Expand Down Expand Up @@ -2248,7 +2248,7 @@ \subsection{Command line}

\begin{verbatim}
% ./capture -a 127.0.0.1 -o trace
Connecting to 127.0.0.1:8086...
Connecting to 127.0.0.1:8087...
Queue delay: 5 ns
Timer resolution: 3 ns
1.33 Mbps / 40.4% = 3.29 Mbps | Net: 64.42 MB | Mem: 283.03 MB | Time: 10.6 s
Expand Down
4 changes: 2 additions & 2 deletions profiler/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum class ViewShutdown { False, True, Join };
static tracy::unordered_flat_map<uint64_t, ClientData> clients;
static std::unique_ptr<tracy::View> view;
static tracy::BadVersionState badVer;
static uint16_t port = 8086;
static uint16_t port = 8087;
static const char* connectTo = nullptr;
static char title[128];
static std::thread loadThread, updateThread, updateNotesThread;
Expand Down Expand Up @@ -400,7 +400,7 @@ static void UpdateBroadcastClients()
protoVer = bm.protocolVersion;
strcpy( procname, bm.programName );
activeTime = bm.activeTime;
listenPort = 8086;
listenPort = 8087;
pid = 0;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions public/client/TracyProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,12 +1538,12 @@ void Profiler::Worker()
auto dataPort = m_userPort != 0 ? m_userPort : TRACY_DATA_PORT;
#else
const bool dataPortSearch = m_userPort == 0;
auto dataPort = m_userPort != 0 ? m_userPort : 8086;
auto dataPort = m_userPort != 0 ? m_userPort : 8087;
#endif
#ifdef TRACY_BROADCAST_PORT
const auto broadcastPort = TRACY_BROADCAST_PORT;
#else
const auto broadcastPort = 8086;
const auto broadcastPort = 8087;
#endif

while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
Expand Down

0 comments on commit 2885772

Please sign in to comment.