54
Server-Side ActionScript Language Reference
You can call either of the two functions that were defined in the previous examples (
foo
and
bar
) by using the following code in a server-side script:
c = new NetConnection();
c.onStatus = function(info) {
if(info.code == "NetConnection.Connect.Success") {
c.call("foo");
c.call("bar", null, 2, 2);
}
};
Client.getBandwidthLimit()
Availability
Flash Communication Server MX 1.0.
Usage
clientObject
.getBandwidthLimit(
iDirection
)
Parameters
iDirection
An
integer
specifying
the connection direction:
0 indicates a client-to-server
direction, 1 indicates a server-to-client direction.
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);
};