
Server-Side Communication ActionScript 37
Client.ip
Availability
Flash Communication Server MX.
Usage
Client.ip
Description
Property (read-only); contains the IP address of the Flash client.
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.protocol
Availability
Flash Communication Server MX
Usage
Client.protocol
Description
Property (read-only); contains a string that indicates the protocol used by the client to connect to
the server. This string can have one of the following values:
• rtmp (Real Time Message Protocol over persistent socket connection)
• rtmpt (RTMP tunneled through HTTP protocol)
For more information about the HTTP tunneling feature in Flash Communication Server MX
see the
NetConnection.connect entry in the Client-Side Communication ActionScript Dictionary.
Example
The following checks the connection protocol used by a client upon connection to the
application.
application.onConnect(clientObj) {
if(clientObj.protocol == "rtmp") {
trace("Client connected over a persistent connection");
} else if(clientOjb.protocol == "rtmpt") {
trace("Client connected over an HTTP tunneling connection");
}
}
Commenti su questo manuale