Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to multiple download much more than 11 torrents #170

Closed
arestov opened this issue Oct 29, 2014 · 4 comments
Closed

Allow to multiple download much more than 11 torrents #170

arestov opened this issue Oct 29, 2014 · 4 comments

Comments

@arestov
Copy link

@arestov arestov commented Oct 29, 2014

code bellow will rise error

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at DHT.EventEmitter.addListener (events.js:160:15)
    at Discovery.setTorrent (C:\webtorent_test\node_modules\webtorrent\node_modules\torrent-discovery\index.js:57:19)
    at Torrent._onSwarmListening (C:\webtorent_test\node_modules\webtorrent\lib\torrent.js:181:18)
    at Swarm.g (events.js:180:16)
    at Swarm.EventEmitter.emit (events.js:95:17)
    at Pool._onlistening (C:\webtorent_test\node_modules\webtorrent\node_modules\bittorrent-swarm\index.js:136:11)
    at Server.g (events.js:180:16)
    at Server.EventEmitter.emit (events.js:92:17)
    at net.js:1055:10
    at process._tickCallback (node.js:415:13)
var WebTorrent = require('webtorrent');

var magnets = [
  ...
];
var client = new WebTorrent();
magnets.forEach(function(item) {
    client.add(item[1]);
});
@arestov

This comment has been minimized.

Copy link
Author

@arestov arestov commented Oct 29, 2014

I'm developing app to search and play music (with node-webkit).
It must download about 12 infoDictionaries in parallel, find mp3 file in infoDictionary for current and next song, and download them.

I'v done some poor integration with torrent-stream (there was no streaming in webtorrent at the summer). But torrent-stream are not supposed for multiple downloads at all (for example it creates new instance of dht for each torrent).

Since I like webtorrent more (it have chrome app support, it's easy to communicate with you) I've switch code to webtorrent, but It is still many problems, so I will make some issues and PRs :)

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Nov 3, 2014

This is not an error, but a warning. It's caused by adding more than 10 listeners for the same event.

If you're using node.js 0.11 or later, you can disable the warning across all modules by running this code:

var EventEmitter = require('events').EventEmitter
EventEmitter.defaultMaxListeners = 0
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Nov 3, 2014

I also manually disabled this warning for bittorrent-dht and webtorrent in node 0.10.

See webtorrent/bittorrent-dht@894ea22 and 5affbe3

The warnings are still enabled if you run webtorrent with debug logs enabled. See: https://github.com/feross/webtorrent#enable-debug-logs

@feross feross closed this Nov 3, 2014
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Nov 3, 2014

Released as 0.12.1.

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.