Giter Club home page Giter Club logo

Comments (7)

darvin avatar darvin commented on May 13, 2024

turns out Peer.prototype._init is never called.

from peerjs.

darvin avatar darvin commented on May 13, 2024

so I traced this call to disconnect before init back to

Peer.prototype._cleanup = function() {
var self = this;
if (!!this.managers) {
var peers = Object.keys(this.managers);
for (var i = 0, ii = peers.length; i < ii; i++) {
this.managers[peers[i]].close();
}
}
util.setZeroTimeout(function(){
self.disconnect();
});
this.emit('close');
}; 

Tests are working, thats only happens in project. I'm using angular js

from peerjs.

darvin avatar darvin commented on May 13, 2024

ok, so that happens on unsupported browser. it called from 👍

/** Destroys the Peer and emits an error message. */
Peer.prototype._abort = function(type, message) {
util.log('Aborting. Error:', message);
var err = new Error(message);
err.type = type;
this.destroy();
this.emit('error', err);
}; 

it tries to destroy non intialized peer before it emts error.

from peerjs.

roeeyud avatar roeeyud commented on May 13, 2024

Having problems with this issue as well, thanks for posting it!
seems to happen even when I only use latest Chrome 27.0.1453.94 .
So I don't think it's related to unsupported browsers... maybe an issue with the browser.
I can't figure out why it happens, one out of 10 connections fail because of this issue.

do you see it as a browser issue?

from peerjs.

ericz avatar ericz commented on May 13, 2024

Got it, disconnect defaults to undefined, should default to true. Fixing now..

from peerjs.

ericz avatar ericz commented on May 13, 2024

Just decided to check if socket exists before closing, peer.disconnected does not correlate with whether socket connection has been made, but rather whether this peer is 'dead' so using that to check wouldn't have made sense.

Anyways, @roeeyud and @darvin, this should be fixed here: a4a3f2d Let me know / reopen issue if you still have problems

from peerjs.

roeeyud avatar roeeyud commented on May 13, 2024

Thanks for that quick response!
No problems with it so far

from peerjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.