56
Server-Side ActionScript Language Reference
Example
The following example uses the
Client.ip
property to verify whether a new client has a
specific IP address. The result determines which block of code runs.
application.onConnect = function(newClient, name){
if (newClient.ip == "127.0.0.1"){
// Insert code here.
} else {
// Insert code here.
}
};
Client.ping()
Availability
Flash Communication Server MX 1.0.
Usage
clientObject
.ping()
Description
Method; sends a “ping” message to the client and waits for a response. If the client responds,
the method returns
true
; otherwise,
false
. Use this method to determine whether the client
connection is still active.
Example
The following
onConnect
function pings the connecting client and traces the results of the
method:
application.onConnect(newClient) {
if (newClient.ping()){
trace("ping successful");
}
else {
trace("ping failed");
}
}
See also
Client.getStats()