Managing Connections - Adobe 65029121 - Flash Media Streaming Server Developer's Manual

Developer's guide
Hide thumbs Also See for 65029121 - Flash Media Streaming Server:
Table of Contents

Advertisement

Okay, let's connect now
connected is: true
event.info.level: status
event.info.code: NetConnection.Connect.Success
Congratulations! you're connected
The line
connected is: true
Flash Player is connected to the server over RTMP. The next two lines describe the
nection object sends to report its connection status:
event.info.level: status
event.info.code: NetConnection.Connect.Success
The
property can have two values,
level
connection. You can check for various
check for a successful connection before you create streams or do other work in your application.
Likewise, when you click the Close button, you see the following:
Now we're disconnecting
connected is: false
event.info.level: status
event.info.code: NetConnection.Connect.Closed
Thanks! the connection has been closed

Managing connections

Connection status codes
Once the connection between client and server is made, it can break for various reasons. The network might go
down, the server might stop, or the connection might be closed from the server or the client. Any change in the
connection status creates a
This is one
and
code
level
Code
NetConnection.Connect.Success
See
in the
NetStatus.info
level values that can be returned in a
When the event is returned, you can access the connection code and level with
. You can also check the
event.info.level
) to see if the connection still exists. If the connection can't be made or becomes unavailable, you need to take
false
some action from the application client.
Managing connections in server-side code
An application might also have server-side code in a main.asc or applicationName.asc file that manages clients trying
to connect (see
Writing server-side code
The server-side code has access to
object, which enables you to manage the application instance. In the server code, you use Server-Side
application
ActionScript and the server-side information objects (see the Server-Side ActionScript Language Reference).
shows the value of the
or
status
error
values in your
code
event, which has both a
netStatus
combination:
Level
status
ActionScript 3.0 Language and Components Reference
event.
netStatus
NetConnection.connected
for an introduction).
objects, which represent individual clients on the server side, and a single
client
NetConnection.connected
. The
property describes the status of the
code
function and take actions. Always
netStatusHandler
and a
code
level
Meaning
A connection has been established successfully.
event.info.code
property (which has a value of
ADOBE FLASH MEDIA SERVER
Developer Guide
property, meaning whether
event the NetCon-
netStatus
property describing the change.
for a complete list of all code and
and
true
21
or

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash media server

Table of Contents