Skip to content

MissionControlServer

Alessandro Febretti edited this page Feb 7, 2016 · 57 revisions

Last revision: ver. 11.1.2 - 6 Feb 2016

Methods

getPort

int getPort()

Gets the tcp port used by the server to accept incoming connections.

findConnection

MissionControlConnection findConnection(string name)

Gets the mission control connection for a specified client. Returns None if no connection with the specified name exists. Note: MissionControlConnection is an opaque object with no methods. It is just used as a handle to a client for broadcastEvent and sendEventTo.

Example

# Send all events from this server to a specific mission control client
def onEvent()
  e = getEvent()
  server = getMissionControlServer()
  target = server.findConnection('targetClient')
  if(target != None):
    server.sendEventTo(e, target)

setEventFunction(onEvent)

broadcastEvent

broadcastEvent(Event evt, MissionControlClient sender)

Broadcasts an event. If sender is not None, the event not be sent to the specified client. - evt: the event object, typically obtained using getEvent() inside an event handler function. - sender: the sender mission control connection. You can get a connection object using MissionControlServer.findConnection()

sendEventTo

sendEventTo(Event evt, MissionControlClient target)

Send an event to the specified client.

### Global Functions ###
#### getMissionControlServer ####
> {MissionControlServer} getMissionControlServer()

Gets the mission control sevrer for this application or `None` if no mission
control server is running.
Clone this wiki locally