well, as far as i understood, there are 2 entry functions when a
client requests a connection to an application;

boolean application.connect(IConnection conn, IScope scope, Object[] params);
boolean application.join(IClient client, IScope scope);

and also 2 exit-notifying functions when a client wants to disconnect

void application.leave(IClient client, IScope scope);
void application.disconnect(IConnection conn, IScope scope);

these 4 functions call their app* or room* counterparts based on
scope, whether this is a base application (rtmp://server/app) or
instance (rtmp://server/app/inst)  (for example, appConnect() or
roomConnect() ), that's defined in
org.red5.server.adapter.ApplicationAdapter


Also, using one of their parameters, IConnection (for
connect()/disconnect()), and IClient (for join()/leave()), we can get
the other one, IClient IConnection.getClient() , or IConnection conn =
Red5.getConnectionLocal(); (this one's used as an example inside
appJoin() method of fitcDemo application)

the counterparts of the functions are no problem; but i'm trying to
understand the connect/disconnect and join/leave distinction.

When application.connect() is called, it receives a connection object.
It can accept or reject the connection only(is this true?) based on
its return value, and it must(is this true?) accept or reject the
connection, it cannot put it in a pending state. Can
application.connect(), at this point, access connection.getClient(),
will it be valid or will it be null until application.connect()
returns true to indicate client can connect?

Assume application.connect() returned true.

Then, i guess(is it so?) the server calls application.join(). First of
all, does the server ALWAYS call application.join() when
application.connect() returns true? Or is there any other mechanism
that can prevent the server from calling application.join() after a
successful application.connect() ?
(for example, first a movie requests connection using a temporary
connection and that calls app.connect(), if that's accepted, the
client reconnects using a permanent connection, and this time server
calls app.join(), but if the client doesn't reconnect, it won't call
app.join(), although app.connect() succeeded --- just a scenario)

After the server calls app.connect(conn), and after it returns true,
calls app.join(client), is it guaranteed that any of the following
will be true?

[in app.connect]conn.getClient() == [in app.join]client
[in app.connect]conn == [in app.join]Red5.getConnectionLocal()


Also another question; return value of app.connect() determines
whether or not the connection is accepted. What is the use of
app.join() 's return value? Is it used as a secondary way to
accept/reject a client, or ?


thanks a lot,
i will try to write a document for application development when i
clarify things in my mind :)

-kerem

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to