MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 151

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 150
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
148
socket.close();
XMLSocket.connect()
myXMLSocket.connect(host, port)
Establishes a connection to the specified Internet host by using the specified TCP port (must be 1024 or higher), and
returns
true or false, depending on whether a connection is successfully established. If you dont know the port
number of the Internet host computer, contact your network administrator.
If you specify
null for the host parameter, the local host is contacted.
The Server-Side ActionScript
XMLSocket.connect() method can connect to computers that are not in the same
domain as the SWF file.
If
XMLSocket.connect() returns a value of true, the initial stage of the connection process is successful. Later, the
XMLSocket.onConnect() handler is invoked to determine whether the final connection succeeded or failed. If
XMLSocket.connect() returns false, a connection could not be established.
Availability
Flash Media Server 2
Parameters
host A string; a fully qualified DNS domain name or an IP address. Specify null to connect to the local host. Do
not enclose IPv6 addresses in square brackets.
port A number; the TCP port number on the host used to establish a connection. The port number must be 1024
or higher.
Returns
A boolean value;
true if successful, otherwise, false.
Example
The following example uses
XMLSocket.connect() to connect to the local host:
var socket = new XMLSocket()
socket.onConnect = function (success) {
if (success) {
trace ("Connection succeeded!")
} else {
trace ("Connection failed!")
}
};
if (!socket.connect(null, 2000)) {
trace ("Connection failed!")
}
Note: Server-side trace() statements are output to the application log file and to the Live Log panel in the Adminis-
tration Console.
XMLSocket.maxUnprocessedChars
myXMLSocket.maxUnprocessedChars
Vedere la pagina 150
1 2 ... 146 147 148 149 150 151 152 153 154 155

Commenti su questo manuale

Nessun commento