Skip to content

MaxListenersExceededWarning from WebSocketTracker #288

@Nuru

Description

@Nuru

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions