
36
Returns
An integer indicating bytes per second.
Description
Method; returns the maximum bandwidth that the client or the server can use for this
connection. Use the
iDirection parameter to get the value for each direction of the connection.
The value returned indicates bytes per second and can be changed with
Client.setBandwidthLimit. The default value for a connection is set for each application in
the Application.xml file.
Example
The following example uses Client.getBandwidthLimit with the iDirection parameter to set
two variables,
clientToServer and serverToClient:
application.onConnect = function(newClient){
var clientToServer= newClient.getBandwidthLimit(0);
var serverToClient= newClient.getBandwidthLimit(1);
};
Client.getStats
Availability
Flash Communication Server MX.
Usage
Client.getStats()
Returns
An object with various properties for each statistic returned.
Description
Method; returns statistics for the client including the total number of bytes sent and received, the
number of RTMP messages sent and received, the number of dropped RTMP messages, and how
long it takes the client takes to respond to a ping message.
Example
The following example uses Client.getStats to output a new client’s statisitics to the Output
window:
application.onConnect( newClient ){
stats = newClient.getStats();
trace("Total bytes received : " + stats.bytes_in);
trace("Total bytes sent : " + stats.bytes_out);
trace("RTMP messages received : " + stats.msg_in);
trace("RTMP messages sent: " + stats.msg_out);
trace("RTMP messages dropped : " + stats.msg_dropped);
trace("Ping roundtrip time: " + stats.ping_rtt);
}
See also
Client.ping
Comentarios a estos manuales