Contents | Index | Previous | Next


TAgentJS.isMasterJS() Method

check master status

Synopsis

Tango_agent.isMasterJS();

Arguments

None.

Returns

Boolean object. True if this application is the session's master.

Description

TAgentJS.isMasterJS() retrieves the value of a fundamental property of a Tango application. The boolean flag describing master status is originally set true if the application is first in session or it owns the session. All joining participants become non-masters. Master status can be granted to another participant and revoked from the session manager. There is, however, always one and only master in session.

Example

It is common that application checks master status right after the registration. Based on this, the application chooses the appropriate code to execute.

<script>

if(Tango_agent.isMasterJS())

//behave as the owner of the session

else

//do not assume owner's responsibilities

</script>

See Also

TAgentJS.getMasterNameJS() method