
NetConnection class
107
Example
The following code closes the NetConnection instance
myNetConn
:
myNetConn.close();
NetConnection.connect()
Availability
Flash Communication Server MX 1.0.
Usage
myNetConnection.connect(
URI
, [
p1, ..., pN
])
Parameters
URI
A URI to connect to.
p1, ..., pN
Optional parameters that can be of any ActionScript type, including
references to other ActionScript objects. These parameters are sent as connection parameters
to the
application.onConnect
event handler for RTMP connections. For AMF
connections to application servers, any RTMP parameters are ignored.
Returns
For RTMP connections, a Boolean value of
true
for success;
false
otherwise. For AMF
connections to application servers,
true
is always returned.
Description
Method; connects to an application server or another Flash Media Server. The host URI has
the following format:
[protocol://]host[:port]/appName[/instanceName]
The following example shows legal URIs:
http://appServer.mydomain.com/webApp
rtmp://rtserver.mydomain.com/realtimeApp
rtmps://rtserver.mydomain.com/secureApp
You can use the
NetConnection.connect()
method to connect to an application server for
server-to-server interactions using standard protocols (such as HTTP) or connect to another
Flash Media Server for sharing audio, video, and data using the Macromedia Real-Time
Messaging Protocol format (RTMP) or SSL (RTMPS). SSL in Flash Media Server uses a
third-party open source library called OpenSSL.