8. ZeroMQ RemoteΒΆ

In order to enable the FSMT ZeroMQ remote control, you need to start FSMT first, using the -e option:

fsmt -e TOPIC:FSMT_IP {other FSMT arguments}

Where TOPIC:FSMT_IP is the TOPICNAME and IP of the host you are running FSMT on. If you run things locally only, you might give mytopic:127.0.0.1 a try. Otherwise, try the external IP of your host.

If you want to stop fsmt remotely via network, you can do this by running

./fsmt_zmq_example

The fsmt_zmq_example script is installed by default in your installation prefix. If you need to implement a stop function in your own code implement the following logic using ZeroMQ:

import sys
import zmq

# ZeroMQ Context
context = zmq.Context()
sock = context.socket(zmq.REP)
connect_string = "tcp://127.0.0.1:1337"
sock.bind(connect_string)

message = sock.recv()
# Send the correct topic in order
# to stop the desired fsmt instance
message = "unittesting1337:stop"
# This stops FSMT
sock.send(message)
print "Sending: " + message