Search

FMS: Pending Clients Before Accepting a Connection

0 views

I'm currently working on a video chat app using Flash Media Server and Flex. This will be version 2 of my Owen to the rescue who suggest to save a reference to it in the application scope: application.onConnect = function(client) { // store client for approval this.client = client; return null; // client is now pending } This way I was able to process the connecting client and once the onSync returned approve it using a function that I could call from anywhere in my code, such as this: approveConnection = function() {    if (application.client)    {    // accept the connection application.acceptConnection(application.client);    } } What I still don't understand if this is really the right way to do it. What would happen if multiple clients connect at the same time - how does this code approve the right client reference? If I had multiple clients in a pending state would this code still work? Right now (with a single client) it works fine but I have a feeling that I may need to match the correct client via a application.clients lookup somehow or risk accepting the wrong one... Can someone clarify? www.flashcomguru.com is one of the largest online resources on Flash Video.

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!