
XMLSocket.connect() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
957
Description
The close() method severs the communication link between socket and a server applica-
tion. Once close() has been executed on
socket, subsequent attempts to invoke send() on
socket fail. Likewise, the server application will no longer be able to send data to Flash
through
socket.
Note that close() has no effect if the
socket is already closed or was never connected.
Furthermore, close() does not trigger the onClose() handler of the socket object—onClose()
is triggered only by a server-side connection closure.
See Also
XMLSocket.connect(), XMLSocket.onClose(), XMLSocket.send()
XMLSocket.connect() Method
open a connection to a server application
Flash 5
socket.connect(host, port)
Arguments
host A string specifying a hostname, such as “www.myserver.com”, or a standard IP
address (four dot-separated, 8-bit, decimal integers, such as 111.222.3.123).
If
null or an empty string is specified, it defaults to the server address from
which the movie was served.
port An integer specifying a TCP port number greater than or equal to 1024.
There is no standard port number reserved (nor is there a widespread conven-
tion) for XMLSocket communications.
Returns
A Boolean indicating the initial success (true) or failure (false) of the connection ...