Problem with p2p session

Ask general questions or talk about OpenTok here! Questions about a specific OpenTok API Platform should be asked in its respective forum.

Problem with p2p session

Postby Guest-owdfrqubef » Sat Nov 10, 2012 6:43 am

Hello,

when I set p2p.preference to "enabled" I have the problem that I get a exception code 1013 if two clients want to connect to the same session.

Every time this happens, both connecting clients get this error.

As this exception code indicates an "p2p connection failed" it would be possible that maybe the clients are not configured to allow UDP/p2p connections - however, then the session should outmatically fall back to a media server.

I the turorial this error code is used to indicate more than one client trying to connect to a p2p session - however in this scenario I did only have two parties and the error was thrown for both of them.

Here is a session which resulted in the described exception:

IssueID 8C42CC21090AB36FF5D10BA4DE17A3BB
SessionId 1_MX4xNzQwOTUyMX5-U2F0IE5vdiAxMCAwNToyMzozOCBQU1QgMjAxMn4wLjM4MDUzMzF-

I got this session info from one of the clients before the other connected to the session - which then led to the exception.

If I set p2p.preference to "disabled" the clients can connect to the session without any problems.

Any ideas what happens here?

Thanks,
Constantin
Was this post helpful? (0)
Guest-owdfrqubef
 
Posts: 4
Joined: Fri Nov 09, 2012 2:35 am
Thumbs Up: 0

Re: Problem with p2p session

Postby jtsai » Mon Nov 12, 2012 11:26 am

Hi there

As you said, this error is because the clients tried to establish a P2P connection, but failed to do so because the proper ports were not opened. Then they fallback to using our servers afterwards. However this error shouldn't stop the people from actually publishing and subscribing. What is the problem you are encountering?

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4974
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 192

Re: Problem with p2p session

Postby Guest-owdfrqubef » Mon Nov 12, 2012 1:10 pm

Hi John,

in my application I have used the code from one of you tutorials (...however, the tutorial seem to be changed now as I can not find the specific code anymore):

Code: Select all
function exceptionHandler(event) {
        if (event.code == 1013) {
          document.body.innerHTML = "This page is trying to connect a third client to an peer-to-peer session. "
             + "Only two clients can connect to peer-to-peer sessions.";
        } else {
          alert("Exception: " + event.code + "::" + event.message);
        }
      }


So how should this error be handled then? As you said the cilents fall back to the media server automatically I guess I should just ignore this error... is this right?

But then, how is the appropriate behaviour to prevent more then 2 parties connecting to a p2p session - what errors are thrown and how should they be handled? Do you have a tutorial covering this situation?

Thanks for your help.
Constantin
Was this post helpful? (0)
Guest-owdfrqubef
 
Posts: 4
Joined: Fri Nov 09, 2012 2:35 am
Thumbs Up: 0

Re: Problem with p2p session

Postby jtsai » Mon Nov 12, 2012 2:24 pm

A 1004 error will be thrown (authentication error) when the third person tries to join the session. You can add an event listener for that error, and do what you want with the client. Right now, we have a bug where the 4th person (after the 3rd person is rejected) to try to join the p2p session will be able to, but we are planning to fix that soon.

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4974
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 192

Re: Problem with p2p session

Postby Guest-owdfrqubef » Tue Nov 13, 2012 2:18 am

Ok, thanks a lot, John!
Was this post helpful? (0)
Guest-owdfrqubef
 
Posts: 4
Joined: Fri Nov 09, 2012 2:35 am
Thumbs Up: 0


Return to Discussion and Questions



Who is online

Users browsing this forum: Alexa [Bot] and 0 guests

cron