FluorineFx.NET

Application Events

Application events

A custom Application Adapter can override the following methods providing access to various steps in the messaging application life cycle.

Event Description

public virtual bool AppStart(IScope application)

Called when an application scope is started. (FCS onAppStart event)

public virtual bool RoomStart(IScope room)

Called when a room scope is started.

public virtual bool AppConnect(IConnection connection, object[] parameters)

Called every time a new client connects to the application.
The "parameters" argument contains the list of parameters passed to the NetConnection.connect method after the connection Url.

public virtual bool RoomConnect(IConnection connection, object[] parameters)

Called every time a new client connects to the application (room).
The "parameters" argument contains the list of parameters passed to the NetConnection.connect method after the connection Url.

public virtual bool AppJoin(IClient client, IScope application)

Called every time client joins application scope. This event is called after the connection is established.

public virtual bool RoomJoin(IClient client, IScope room)

Called every time client joins room scope. This event is called after the connection is established.

public virtual bool RoomLeave(IClient client, IScope room)

Called every time client leaves room scope. This event is called before the connection is disconnected from the scope.

public virtual bool AppLeave(IClient client, IScope application)

Called every time client leaves application scope. This event is called before the connection is disconnected from the scope.

public virtual bool RoomDisconnect(IConnection connection)

Called every time client disconnects from the application.

public virtual bool AppDisconnect(IConnection connection)

Called every time client disconnects from the application.

public virtual bool RoomStop(IScope room)

Called when a room scope is stopped.

public virtual bool AppStop(IScope application)

Called when an application scope is stopped. (FCS onAppStop event)

 

Execution order of connection events

Assuming that the client is connecting to rtmp://server/app/room1/room2

At first, the connection is established, so the user "connects" to all scopes that are traversed up to room2:

  1. app(-> AppConnect)
  2. room1(-> RoomConnect)
  3. room2 (-> RoomConnect)

After the connection is established, the client object is retrieved and if it is the first connection by this client to the scope, joins the scopes:

  1. app(-> AppJoin)
  2. room1(-> RoomJoin)
  3. room2(-> RoomJoin)

If the same client establishes a second connection to the same scope, only the connect methods will be called. If you connect to partially the same scopes, only a few join methods might be called, e.g. rtmp://server/app/room1/room3 will trigger:

  1. app(-> AppConnect)
  2. room1(-> RoomConnect)
  3. room3(-> RoomConnect)
  4. room3(-> RoomJoin)