Closed OnkelTem closed 5 years ago
Hi @OnkelTem Thank you for your report, there's a race condition bug in js sdk not allowing to connect simultaneously. This will be fixed. You can avoid that if you start second session once first one already established. Consider this pattern:
let session1;
let session2;
ZCC.Sdk.init({
player: true,
widget: false
}).then(function() {
session = new ZCC.Session({
serverUrl: 'wss://zello.io/ws/',
channel: channel,
authToken: token,
username: username,
password: password
});
session.connect().then(() => {
console.log('Connected 1st session');
session2 = new ZCC.Session({
serverUrl: 'wss://zello.io/ws/',
channel: channel2,
authToken: token,
username: username2,
password: password2
});
session2.connect().catch((err) => {
console.log('Connected 2nd session');
});
}).catch((err) => {
console.trace(err);
});
}).catch(function(err) {
console.trace(err);
});
please also note that if you're connecting using username and password (not listenOnly mode) then you can have only one session per username
Thank you Mikhail, I got it. Would be great to have this fixed :)
this is fixed
When I try to connect to more than one channel I get this error message:
It's actually the same as I was getting yesterday: https://github.com/zelloptt/zello-channel-api/issues/49 but now it seems to be reproducable for any two channels. Sure this error is not the same as in the referenced issue.
I use a development token.
JS library version is 0.4