
43
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Availability
Flash Media Server 3
Example
The following onConnect() function traces the ID of the connecting client:
application.onConnect(newClient) {
trace(newClient.id);
}
Client.introducePeer()
clientObject.introducePeer(initiatorAddress:String, tag:ByteArray)
Opens a peer-to-peer connection with a peer that requested a connection. The peer that requests the connection is
called the initiating peer. The initiating peer requests a connection with a target peer. To open the connection, the
target peer calls this method and passes the address for the initiating peer and the tag for the introduction request.
Call this method to Distribute peer introductions across multiple servers.
Availability
Flash Media Server 4.5
Parameters
initiator String. The address that the lookup request of the initiating peer came from.
tag ByteArray. The tag identifying the specific lookup request issued by the initiating peer. This value must be handed
back in order for the initiating peer to properly correlate and associate the connection attempt from this client to it.
Returns
Nothing.
Client.ip
clientObject.ip
Read-only; A string containing the IP address of the client.
Availability
Flash Communication Server 1
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.
}
};
Komentáře k této Příručce