Can't establish connection between peers

257 views
Skip to first unread message

the.co...@gmail.com

unread,
Oct 21, 2013, 5:20:53 PM10/21/13
to pee...@googlegroups.com
Hello, Im using the latest peerjs lib v.3.0.1. Im testing p2p connectivity on the same PC (host + guest vm running in virtualbox) and I have problems with establishing of connection for such an environment. Actually connection could not be established

Here is the code (cut) Im using:

/* create peer */
peer = new Peer(_id, config.p2p); //tried turn server on/off
peer.on('open', function(__id){
/* connect to peers */
_this._connect(peer_id);
});

/* handle incoming connections */
peer.on('connection' ,function(conn){
debug.log('p2p: new peer connected');
});
/* handle error */
peer.on('error' ,function(err){
debug.log('p2p: error opening connection ' + err);
});

/* connect to peer */
this._connect = function(_peerId){
var conn = peer.connect(_peerId, {
'reliable': false //tried reliable: false/true here
});
conn.on('open', function(){
conn.on('data', function(data){
_this.forward(data);
});
});
}

Both peers (guest B & host A machines) are created without problems. Then I try to establish the connection from A:

_connect("18b23a1b420ab7e46dedf503502b94aa2e41c1db95e4bacaabd63f5cc5f5d696")

in the console on B I see incoming connection:
> p2p: new peer connected

And after this an error occurs:
> p2p: error opening connection CreateAnswer failed.

Connection is present in the peer.connections (A & B) but open=false and I cant send any data at all.

This is very annoying issue and I have no idea what to do with it. What's the most interesting - everything works perfect with peerjs v.0.2.8. Is it a bug, or?

And one small notice: clients with peers 0.2.8 & 3.0.x cant connect to each other

Please help me on this. Thank you

Michelle Bu

unread,
Oct 21, 2013, 5:25:46 PM10/21/13
to the.co...@gmail.com, peerjs
Are you able to connect two peers with our chat demo?
http://cdn.peerjs.com/demo/chat.html
Michelle

the.co...@gmail.com

unread,
Oct 21, 2013, 5:36:58 PM10/21/13
to pee...@googlegroups.com, the.co...@gmail.com, miche...@berkeley.edu
I dont think so. When connecting from A to B situation is next:
* B shows new connection "Chat with heokkpzfmjthuxr"
* A still shows "You have not yet made any connections."
Sending a message from B to A results in nothing

And when I try to connect from B to A - A crashes (chrome crash page) (but maybe thats not supported by code)

A is running 31.0.1650.26 beta-m
B is running 30.0.1599.101 m

Just switched to 0.2.8 branch and tried to connect from host to guest, everything works perfect

416abdf24c07e3b7da889fe17c2be96adc9a4c4fd02ded90a9e9bc5ef78b23ea: Object
peerjs: DataConnection
_dc: RTCDataChannel
...
open: true

Michelle Bu

unread,
Oct 21, 2013, 5:38:13 PM10/21/13
to the.cooljames, peerjs
Cool, will look into it. My guess is that some of the configurations
we're using for Media connections don't play nicely with Chrome 31.
Michelle

the.co...@gmail.com

unread,
Oct 21, 2013, 5:54:12 PM10/21/13
to pee...@googlegroups.com, the.cooljames, miche...@berkeley.edu
After switching to stable channel - it worked. Anyway please take care about v.31 which will be released quite soon. Thank you
Reply all
Reply to author
Forward
Message has been deleted
0 new messages