MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Bedienungsanleitung Seite 35

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 172
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 34
32
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
application.rejectConnection()
application.rejectConnection(clientObj[, description[, errObj])
Note: The description parameter is supported in Flash Media Server 3 and later.
Rejects the connection call from a client to the server. The application.onConnect() handler is invoked when the
client calls
NetConnection.connect(). In the application.onConnect() handler, you can either accept or reject
the connection. You can also make a call to an application server to authenticate the client before you accept or reject it.
Note: When you use version 2 components, the last line (in order of execution) of the onConnect() handler should be
either
application.acceptConnection() or application.rejectConnection() (unless you’re leaving the
application in a pending state). Also, any logic that follows
acceptConnection() or rejectConnection() must be
placed in
application.onConnectAccept() and application.onConnectReject() handlers, or it is ignored. This
requirement exists only when you use version 2 components.
Availability
Flash Communication Server 1
Parameters
clientObj A Client object specifying a client to reject.
description A string that allows you to provide more information when a connection is redirected.
errObj An object of any type that is sent to the client, explaining the reason for rejection. The errObj object is
available in client-side scripts as the
application property of the information object that is passed to the
NetConnection.onStatus() call when the connection is rejected.
Example
In the following example, the client is rejected and sent an error message. This is the server-side code:
application.onConnect = function(client){
// Insert code here.
var error = new Object();error.message = "Too many connections";
application.rejectConnection(client, error);
};
This is the client-side code:
clientConn.onStatus = function (info){
if (info.code == "NetConnection.Connect.Rejected"){
trace(info.application.message);
// Sends the message
// "Too many connections" to the Output panel
// on the client side.
}
};
application.sendPeerRedirect()
application.sendPeerRedirect(redirectAddress:Array, event:Object)
When a peer requests a lookup for a target peer, call this method to send the peer an Array of addresses for the target
peer. Call this method from the
application.onPeerLookup() callback function.
See Distribute peer introductions across multiple servers.
Seitenansicht 34
1 2 ... 30 31 32 33 34 35 36 37 38 39 40 ... 171 172

Kommentare zu diesen Handbüchern

Keine Kommentare