
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
149
The number of characters the connection can receive from the XML server without receiving an end tag or the
XMLSocket connection closes. The value of
XMLSocket.maxUnprocessedChars can be -1 or any value greater than
0. The value -1 means that an unlimited amount of data can be processed. However, the value of
maxUnprocessedChars cannot exceed the value specified in the Application.xml file. The default value in the Appli-
cation.xml file is 4096 bytes.
Setting this property in a server-side script overrides the value of the
MaxUnprocessedChars element in the Appli-
cation.xml file for each XMLSocket object. If the property is not set in a server-side script, the server uses the value
set in the
MaxUnprocessedChars element of the Application.xml file.
Availability
Flash Media Interactive Server
XMLSocket.onClose()
myXMLSocket.onClose = function() {}
Invoked when an open connection is closed by the server. The default implementation of this method performs no
actions. To override the default implementation, you must assign a function containing custom actions.
Availability
Flash Media Server 2
Example
The following example executes a
trace() statement if an open connection is closed by the server:
var socket = new XMLSocket();
socket.connect(null, 2000);
socket.onClose = function () {
trace("Connection to server lost.");
}
Note: Server-side trace() statements are output to the application log file and to the Live Log panel in the Adminis-
tration Console.
XMLSocket.onConnect()
myXMLSocket.onConnect = function(success) {}
Invoked by Flash Media Interactive Server when a connection request initiated through XMLSocket.connect()
succeeds or fails. If the connection succeeded, the
success parameter is true; otherwise, false.
The default implementation of this method performs no actions. To override the default implementation, you must
assign a function containing custom actions.
Availability
Flash Media Server 2
Parameters
success A boolean value indicating whether a socket connection is successfully established (true or false).
Example
The following example defines a function for the
onConnect() handler:
socket = new XMLSocket();
Commenti su questo manuale