Groups | Blog | Home
all groups > macromedia flash flashcom > october 2005 >

macromedia flash flashcom : Remove finished video streams from system


maddogg54
10/7/2005 12:00:00 AM
Does anyone know how to remove unused streams from FCS? I have a training
application that is very video heavy and i have about 80 - 100 students using
it, the problem is with terminating finished streams. It seems that FCS is
holding onto the streams that have ended using up connections, and therefore
not allowing some of the later videos in the lesson to play. Please help.
dejayfx
10/7/2005 12:00:00 AM
it was kinda late and i dont remember which file it was, but read through the
server's xml configs, they are well commented, and you'll find the line
concerning how fast idle apps are discarded. or app instances, rather.
JayCharles
10/7/2005 8:06:30 PM
I'm not sure I'm following you here.

Is the problem that streams aren't being terminated, or that clients aren't
being seen as disconnected when they leave? If it's the later, you're running
into a little bug that has been a problem since the beginning of FCS.

When a user quits the application by closing the browser window or navigatin
to another page, FCS sometimes doesn't recognize that the user is gone, and
continues to see an open connection. The only sure fire way round this is to
have your users press a button in the swf that will call a
netconnection.close() function. Of course, you can't always count on your users
to press that logout button, so you'll want the server to catch that.

The way I like to handle this is to have a server side routine that pings each
client at a given interval (I like to do it every 5 seconds). If the ping is
returned, the client is still (genuinely) there. If the ping isn't returned,
the client is gone, and a function is called to disconnect the user from the
server side.
maddogg54
10/8/2005 12:00:00 AM
Streams being terminated after the viewer is done with one video and then opens
a new stream with a new video, the original is not being killed so by the end
of say my 5 min GC settings there could be one user that may have 2 - 10
streams used. Keep in mind we run 75 - 100 students at a time.

Thanks
JayCharles
10/8/2005 12:00:00 AM
The number of open streams won't affect your bandwisth or user cap, so I'm
guesing there's a problem in your actionscript. If you can post your code I can
offer more advice.

Keep in mind that you only need one netstream if you're only playing one video
at a time. Somewhere in your client side AS, you're establishing a netstream
and playing a video over it. You can call other videos to play over the same
stream using netstream.play(). There's no need for opening additional streams.

maddogg54
10/8/2005 12:00:00 AM
JayCharles
10/8/2005 8:01:27 PM
I almost never use the MM components for FCS connectivity, but I'm guessing
that you're not resuing the same rtmp connection for each video stream. Are you
specifying the rtmp address for each video in the component inspector for the
componant instances themselves? If that's the case, it's likely that you're
making an additional connection to the FCS for each video, without closing the
previous connection. That's a very bad practice, and will adversely affect the
performance of both the client and the server.

Please explain how you're making your connections to the FCS server.
maddogg54
10/8/2005 8:47:26 PM
I am using the component inspector and just typing in the rtmp: for each one.
and yes it is really hindering the performance, I just can't ever find good
examples of what to do so I am just winging it.
JayCharles
10/8/2005 9:01:06 PM
That's what I figured. Each component instance is making a separate connection
to the server. Since I don't use the components, I'm not familiar with how the
component's nectconnection.close() method is fired. I couldn't find anything in
the docs about it. Perhaps someone who is more familiar with the MM components
can shed sme light on this one.

You might try using the setMedia() method on the playback component to change
the video, rather than having separate instances of the video player. I don't
know if that will close the current netConnection, but it's worth a shot.

Incidentally, I'd suggest picking up a copy of "Programming Flash
Communication Server" (O'Reilly). It's the most comprehensive FCS book I've
come across. The book provides everything you need to understand basic
Flash/FCS programming, and will free you from the constraints of the MM
components.
maddogg54
10/8/2005 9:15:49 PM
AddThis Social Bookmark Button