When I seed a lot of torrents from Node.js via webtorrent-hybrid, I get MaxListenersExceededWarning from WebSocketTracker._openSocket . I think this is because multiple torrents are listening on the same pooled WebSocket, and thus this is not a genuine bug or memory leak. If I'm right about that, then I would like to have a sane way to set the warning limit to be something proportional to the number of torrents I am seeding.
I know this warning can be suppressed by setting EventEmitter.defaultMaxListeners to a bigger number, but that has global effect and I do not want to suppress the warning globally. I would be willing to call emitter.setMaxListeners() myself if there is not a reasonable way for bittorrent-tracker to figure out the right value, but I need an API for that which lets me get to the WebSocketTracker from the webtorrent-hybrid client object.
When I seed a lot of torrents from Node.js via
webtorrent-hybrid, I getMaxListenersExceededWarningfromWebSocketTracker._openSocket. I think this is because multiple torrents are listening on the same pooledWebSocket, and thus this is not a genuine bug or memory leak. If I'm right about that, then I would like to have a sane way to set the warning limit to be something proportional to the number of torrents I am seeding.I know this warning can be suppressed by setting
EventEmitter.defaultMaxListenersto a bigger number, but that has global effect and I do not want to suppress the warning globally. I would be willing to callemitter.setMaxListeners()myself if there is not a reasonable way forbittorrent-trackerto figure out the right value, but I need an API for that which lets me get to theWebSocketTrackerfrom thewebtorrent-hybridclient object.