Page 1 of 1

RE: Red box NetConnection.Connect.Failed

Posted: 25 Feb 2009, 13:36
by thesamuraielephant
Hi,

I'm having some problems getting an AVCastManager to init succesfully.
When I init, it gives the following response (in debug mode):

Room AVChatRoom joined successfully
[RedBox] Initializing Live Casts list for current room...
[ RECEIVED ]: <msg t='sys'><body action='uCount' r='31' u='1'></body></msg>, (len: 61)
[RedBox] NetStatusEvent response received
[RedBox] Level: error | Code:NetConnection.Connect.Failed
[RedBox] NetConnection error, dispatching event...

I've already read the setup guide and made sure red5 has been started (using red5.sh).

Are there any config settings I should change in the default RedBox/Red5 setup (or smartfox) to get it working?

Best Regards,

David

Posted: 26 Feb 2009, 06:08
by Lapo
Red5 runs on port 1935, make sure you have no firewall rules blocking access to that TCP port in both directions (incoming, outgoing)

Posted: 26 Feb 2009, 09:49
by thesamuraielephant
Port 1935 was open incoming and outgoing (according to our admin), I changed the url I used in instantiating the AVCastManager to this:

_avCastMan = new AVCastManager(_smartFox, Config.IP+":"+Config.RMTP_PORT, true);

including the port (1935) in the URL.

This fixed the problem.

Thanks,

David

Posted: 26 Feb 2009, 10:34
by Lapo
:shock: :shock:
This is weird to say the least :)
Normally you don't need to specify the port if you use the default one, and we are pretty sure that this is how it's always been working... are you using Flash Player 10?
Maybe they added some new security quirk for rtmp connections? Sounds odd in any case :?

Posted: 26 Feb 2009, 10:58
by thesamuraielephant
Nope, I built the swf using FlashCS3 targetting player 9.

I also had an issue with AVCastManager.getAvailableCasts();

the castList was always returned as empty after I instantiated the AVCastManager (directly after joining a room).

Not too sure about why that happens (although it seems like it clears itself, because I can see the traces coming through about "adding livecast to castlist").

Thanks,

David

Posted: 27 Feb 2009, 09:51
by Bax
Not sure why the castList is empty... are you sure users are already broadcasting when you join the same room?
Just after initialization you should see some a trace like this for each user who is already broadcasting: "Live cast found for user" + username

Posted: 06 Jan 2012, 23:16
by darrenortiz
Has there been any solution to the empty getAvailableCasts problem? I don't know why it's ALWAYS coming up either null or empty.

Here's the flow I'm using:
    initiate SmartFox

    wait for onConnection to be triggered

    once connected to SmartFox, login to the zone I want

    wait for the room list to be updated

    once the room list is updated, initialize RedBox

    wait for RedBox to be initialized

    once Redbox is inited, join the room I want

    wait for onJoinRoom

    once I've joined the room, start publishing my stream, and get list of other streams via getAvailableCasts()


No matter what though, getAvailableCasts is always empty.

Fixed

Posted: 07 Jan 2012, 17:01
by darrenortiz
So I've solved my problem regarding the empty getAvailableCasts array. It's not that it's empty. It's that it's an associative array.

So instead of doing:
for(i=0; i < length; i++)

You have to do:
for each(var livecast:LiveCast in array)

Although the first method should work regardless, it's actually because I was limiting "length" to the max number of streams I was expecting.
So I was doing:
length = Math.min(getAvailableCasts.length, maxStreams)

*pseudo code*