
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
82
|
Chapter 3: Managing Connections
Each one of these URIs is an address of a separate instance of the chatRooms
application even though two of them contain the name “room8”. The instance
name
/chatRooms/motionPicture/film001/room8 is not the same as chatRooms/
science/phys325/room8
.
Relative URIs
If a .swf file is loaded into a browser from the same server that FlashCom is running
on, you can use a relative URI in which the
// characters and hostname are omitted.
Here is the format for a relative URI:
rtmp[t]:[:port]/applicationName[/instanceName]
In the earlier rtmp:/testLobby example, the protocol is rtmp, the single slash indicates
a relative URI, and testLobby is the application name. No application instance name
is provided, so the
_definst_ instance is assumed.
Waiting to Connect
After a successful connect( ) method invocation (one in which the URI is properly
formed), the NetConnection object must wait to see if the connection attempt itself is
successful. This can take some time as a number of things can happen:
• The server may be down or unreachable, in which case the connection attempt
will eventually fail.
• The network may be slow or the server may be busy.
• The application instance may accept the TCP network connection but place it in
a pending state while it decides if it should ...