RE: Red box NetConnection.Connect.Failed

Post your questions and bug-reports about the audio/video streaming add-on based on Red5 Media Server.

Moderators: Lapo, Bax

thesamuraielephant
Posts: 3
Joined: 25 Feb 2009, 13:31

RE: Red box NetConnection.Connect.Failed

Postby thesamuraielephant » 25 Feb 2009, 13:36

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
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 26 Feb 2009, 06:08

Red5 runs on port 1935, make sure you have no firewall rules blocking access to that TCP port in both directions (incoming, outgoing)
Lapo
--
gotoAndPlay()
...addicted to flash games
thesamuraielephant
Posts: 3
Joined: 25 Feb 2009, 13:31

Postby thesamuraielephant » 26 Feb 2009, 09:49

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
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 26 Feb 2009, 10:34

: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 :?
Lapo

--

gotoAndPlay()

...addicted to flash games
thesamuraielephant
Posts: 3
Joined: 25 Feb 2009, 13:31

Postby thesamuraielephant » 26 Feb 2009, 10:58

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
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 27 Feb 2009, 09:51

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
Paolo Bax
The SmartFoxServer Team
darrenortiz
Posts: 9
Joined: 06 Jan 2012, 22:38

Postby darrenortiz » 06 Jan 2012, 23:16

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.
darrenortiz
Posts: 9
Joined: 06 Jan 2012, 22:38

Fixed

Postby darrenortiz » 07 Jan 2012, 17:01

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*

Return to “RedBox”

Who is online

Users browsing this forum: No registered users and 12 guests