When you use components and your code includes an explicit call to
application.acceptConnection
order of execution) of the onConnect method should be either
application.acceptConnection
follows the explicit acceptConnection or rejectConnection statement must be placed in
application.onConnectAccept
be ignored. This requirement exists only when you use components.
Example
In the following example, the client specified by
error message contained in
the server side.
function onConnect(client1){
// Insert code here.
var err = new Object();
err.message = "Too many connections";
application.rejectConnection(client1, err);
}
The following code should appear on the client side:
clientConn.onStatus = function (info){
if (info.code == "NetConnection.Connect.Rejected"){
trace(info.application.message);
// Sends the message
// "Too many connections" to the Output panel
// on the client-side.
}
};
See also
Application.onConnect
or
application.rejectConnection
or
application.rejectConnection
and
application.onConnectReject
. The message "Too many connections" appears on
err.message
,
Application.acceptConnection()
is rejected and provided with the
client1
, the last line (in
. Also, any logic that
statements, or it will
Application class
43
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?