==========================================
PragmaDev Tracer client examples directory
==========================================

In this directory, you will find two examples of client programs that
communicate with PragmaDev Tracer:

- SimpleClient:
  Sends a few pre-defined commands to the tracer. This client works both with
  the tracer GUI and the command line interface.
- MultiTraceClient:
  Automatically opens several traces from the client. This client works only
  with the tracer command line interface.

Please see the comment at the top of the corresponding source file for further
details.


Compiling the examples:
-----------------------

- on Linux and macOS:
  gcc -o <example> <example>.c TracerSocketConnection.c
 
- on Windows/MinGW32:
  mingw32-gcc -o <example>.exe <example>.c TracerSocketConnection.c -l ws2_32


Using the examples:
-------------------

The tracer must be launched first:
- If you're using the GUI, launch PragmaDevStudio, then choose 'New MSC trace
  from socket' from the 'Project' menu. Then wait for the tracer window to
  appear and for the message in the lower-left part of the window to show
  'Tracing'.
- If you're using the command line interface, open a terminal, go to the
  directory where the trace diagrams must be stored, then run:
  pragmastudiocommand tracer [ -p <port number> ]
  If you don't specify a port number via the -p option, the tracer will use the
  one configured in PragmaDevStudio's preferences ('Tracer' tab, option 'Socket
  port number').
  Then wait for the message 'Connection ready. Waiting for clients.'

Once PragmaDev Tracer is up and running, run the example like follows:

<example> [ipAddress] portNumber

- ipAddress is the ip address of the host where PragmaDev Tracer is running. If both
  client and PragmaDev Tracer run on the same host, this parameter can be omitted.
- portNumber is the socket port specified in the PragmaDev Tracer preferences or on the
  command line.
