5. Examples

C++ usage

The C++ sender/receiver examples lives in the ifw-rtmslib user manual, alongside the full API reference. Consult that manual for code samples illustrating publishers and subscribers built directly on the RTMS library.

Command line example

End-to-end flow with the utilities and DDT (broker, sender, receiver, viewer):

  1. Start DDT broker (if not already running):

    $ ddtBroker --uri zpb.rr://*:12011 &> /dev/null &
    
  2. Start the RTMS sender:

    $ rtmstoolsSender \
        -i /elt/ifw/resource/image/ifw/ccf/cube_10_16_bit.fits \
        -q 1 -n 100000000 \
        -s 127.0.0.1 -d 127.0.0.1 -p 59000 \
        -m 1500 -t 10 -c 12345 \
        -l INFO --ignore-conn-refused --packet-send-delay-microsec 10
    
  3. Start the RTMS receiver:

    $ rtmstoolsReceiver_llnetio \
        --address 127.0.0.1 --netif 127.0.0.1 --port 59000 \
        --width 512 --height 512 --data_type Int16 --topic-id 10 \
        --mtu-size 1500 --log-level INFO \
        --broker-uri zpb.rr://127.0.0.1:12011/broker/Broker1 \
        --ddt-stream rtms-test
    
  4. Start a DDT viewer:

    $ ddtViewer -l zpb.rr://127.0.0.1:12011/broker/Broker1 -s rtms-test &> /dev/null &
    

These steps mirror common integration tests: start the broker, push frames with the sender, monitor/relay with the receiver, and visualise the stream with the viewer.