Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > XMLSocket | |||
Object
|
+-XMLSocket
public class XMLSocket
extends Object
The XMLSocket class implements client sockets that let the computer running Flash Player communicate with a server computer identified by an IP address or domain name. The XMLSocket class is useful for client-server applications that require low latency, such as real-time chat systems. A traditional HTTP-based chat solution frequently polls the server and downloads new messages using an HTTP request. In contrast, an XMLSocket chat solution maintains an open connection to the server, which lets the server immediately send incoming messages without a request from the client. To use the XMLSocket class, the server computer must run a daemon that understands the protocol used by the XMLSocket class. The protocol is described in the following list:
The following restrictions apply to how and where an XMLSocket object can connect to the server:
Setting up a server to communicate with the XMLSocket object can be challenging. If your application does not require real-time interactivity, use the loadVariables() function, or Flash HTTP-based XML server connectivity (XML.load(), XML.sendAndLoad(), XML.send()), instead of the XMLSocket class. To use the methods of the XMLSocket class, you must first use the constructor, new XMLSocket, to create an XMLSocket object.
Availability: ActionScript 1.0; Flash Player 5
Properties inherited from class Object
|
Event |
Description |
|---|---|
|
onClose |
Invoked only when an open connection is closed by the server. |
|
onConnect |
Invoked by Flash Player when a connection request initiated through |
|
onData |
Invoked when a message has been downloaded from the server, terminated by a zero (0) byte. |
|
onXML |
Invoked by Flash Player when the specified XML object containing an XML document arrives over an open XMLSocket connection. |
|
Signature |
Description |
|---|---|
|
Creates a new XMLSocket object. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
close |
Closes the connection specified by XMLSocket object. |
|
|
connect |
Establishes a connection to the specified Internet host using the specified TCP port (must be 1024 or higher), and returns |
|
|
send |
Converts the XML object or data specified in the |
Methods inherited from class Object addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00002906.html