78
Debugging and Monitoring Applications
About the System.onStatus handler
In addition to the specific
onStatus
methods provided for the classes listed in
“About
onStatus event handlers” on page 76
, Flash also provides a “super handler” called
System.onStatus
. If
onStatus
is invoked for a particular object with a level property of
Error
and no function is assigned to respond to it, Flash processes a function assigned to
System.onStatus
if it exists.
The following code example sends a message to the Output panel when an error message
occurs for an object that hasn’t been assigned an
onStatus
handler:
System.onStatus = function(genericError) {
// Your script would do something more meaningful here.
trace("An error has occurred. Please try again.");
}
About debugging a
NetConnection.Connect.Failed message
If a
NetConnection.connect()
command returns an information object with a
code
value
of
NetConnection.Connect.Failed
, you cannot establish a connection with the server.
Every time you receive this error, ask yourself some standard troubleshooting questions:
■
Are you connecting to the correct server?
■
Is the server running?
■
Are you specifying the protocol (rtmp:) for connecting to the server?
■
If you are connecting from behind a firewall, are you specifying the correct protocol
(rtmpt:)?
Attempts to connect to the server can also fail if the permissible number of socket connections
on either the client or the server computer is at its limit. This limit is dependent on how much
physical memory your server has, and how busy the connections are. On Windows systems,
the memory for socket connections is allocated out of the non-paged memory, so it cannot be
swapped out to a page file. You may see that you reach the maximum limit at different values
from time to time as other running programs (such as core operating-system services) are
competing with your program for space in the non-paged memory pool.
Summary of Contents for FLASH MEDIA SERVER 2-DEVELOPING MEDIA
Page 1: ...Developing Media Applications ...
Page 6: ...6 ...
Page 10: ...10 About This Manual ...
Page 36: ...36 Flash Media Server Architecture ...
Page 80: ...80 Debugging and Monitoring Applications ...
Page 106: ...106 Application Development Tips and Tricks ...
Page 114: ...114 ...