Skip to content

MissionControlClient

Alessandro Febretti edited this page Feb 4, 2016 · 14 revisions

module omega

Last revision: ver. 11.1 - 2 Feb 2016

Implements a mission control client. Mission control is a protocol used to communicate to running omegalib * instances, or let different instances to connect with each other and exchange data or python commands. The default mission control client (if available) can be obtained with the global getMissionControlClient() function call.

Methods

Method(s) Description
static MissionControlClient create() Creates a new mission control client.
connect(string host, int port) Connects to a mission control server on the specified host and port. The default port used by mission control servers is 22500.
dispose() Shuts down the client
setName(string name), string getName() Sets or gets this connection's name. The connection name may be used in log information to identify the client.
postCommand(string command) Sends a script command to all the other connected clients. If the string starts with @clientId:, the command will be sent only to the client called clientId. If you end clientId it with a * character, all clients matching the prefix will receive the specified command.
bool isConnected() Returns true if the client is connected to a server.
closeConnection() Closes the connection. If no connection is open, does nothing.
string-list listConnectedClients() Returns a list containing the names of all the clients connected to this session
setClientConnectedCommand(string cmd) Sets a command to be executed when a new client connects to this sessions. The command string can contain a %clientId% token that will be substituted with the client name.
setClientDisonnectedCommand(string cmd) Sets a command to be executed when a client disconnects to this sessions. The command string can contain a %clientId% token that will be substituted with the client name.
setClientListUpdatedCommand(string cmd) Sets a command to be executed when the list of client names changes. This will be executed when a client connects, disconnects or changes its name.
(v11.1) bool spawn(string id, int slot, string script, string configuration) Starts a new instance of omegalib using the specified script and configuration file. The instance will use mission control to connect to the same server this instance is connected to. Returns true if the script has been launched successfully. Note: this does not mean the instance is already running and connected back. You ill need to use the setClientConnectedCommand method for that. The slot argument needs to be a unique numerical identifier for the application, used as the app instance id (see the -I command line argument)
Clone this wiki locally