Application.acceptConnection()

Availability

Flash Communication Server MX 1.0.

Usage

application.acceptConnection(clientObj) 

Parameters

clientObj A Client object; a client to accept.

Returns

Nothing.

Description

Method; accepts the connection call from a client to the server. The application.onConnect event handler is invoked on the server side to notify a script when NetConnection.connect() is called from the client side. You can use the application.acceptConnection() method in an application.onConnect event handler to accept a connection from a client. You can use the application.acceptConnection() method outside an application.onConnect event handler to accept a client connection that had been placed in a pending state (for example, to verify a user name and password).

When you use components and your code includes an explicit call to application.acceptConnection() or application.rejectConnection(), the last line (in order of execution) of the onConnect event handler should be either application.acceptConnection() or application.rejectConnection(). Also, any logic that follows the explicit acceptConnection or rejectConnection statement must be placed in application.onConnectAccept and application.onConnectReject statements, or it will be ignored. This requirement exists only when you use components.

Example

The following example uses the application.acceptConnection() method to accept the connection from client1:

application.onConnect = function (client1){
    // Insert code here.
    application.acceptConnection(client1);
    client1.call("welcome");
};

NOTE

 

This example shows code from an application that does not use components.

See also

Application.onConnect, Application.rejectConnection()


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000641.html