Application class
45
Description
Method; unloads the application instance.
If the application is running in vhost or application-level scope, only the application instance
is unloaded, but the core process remains running. If the application is running in instance
scope, the application instance is unloaded and the core process terminates. This process is
done asynchronously; the instance is unloaded when the unload sequence begins, not when
the
shutdown()
call returns.
After
shutdown()
is called,
Application.onAppStop
is called, connected clients are
disconnected, and
Application.onDisconnect
is called for each client. Calls made after
calling
shutdown()
may not execute.
Example
In the following example, the client specified by
client1
is rejected and provided with the
error message contained in
err.message
. The message “Too many connections” appears on
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
,
Application.acceptConnection()