User Guide
484 Chapter 6: ActionScript Core Classes
Parameters
None.
Returns
Nothing.
Description
Method; closes the connection specified by XMLSocket object.
Example
The following simple example creates an XMLSocket object, attempts to connect to the server,
and then closes the connection.
var socket:XMLSocket = new XMLSocket();
socket.connect(null, 2000);
socket.close();
See also
XMLSocket.connect()
XMLSocket.connect()
Availability
Flash Player 5; behavior changed in Flash Player 7.
Usage
myXMLSocket.connect(host:String, port:Number) : Boolean
Parameters
host
String; a fully qualified DNS domain name or an IP address in the form aaa.bbb.ccc.ddd.
You can also specify
null to connect to the host server on which the SWF file resides. If the SWF
file issuing this call is running in a web browser,
host must be in the same domain as the SWF
file; for details, see “Description”.
port A number; the TCP port number on the host used to establish a connection. The port
number must be 1024 or greater.
Returns
A Boolean value.
Description
Method; establishes a connection to the specified Internet host 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 don’t know the port number of your Internet host computer,
contact your network administrator.