mafintosh / mafintosh/utp

End method is missing

Open
#3 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
92
Forks
11
PR merge metrics
No merged PRs in 30d

Description

The module is calling a .end method that does not exist.

Suggested modification:

Connection.prototype.end = function() {
this.emit('end' or 'close');
};

I don't know the rationale of the check of 'tick' for the 'end' event but if you call destroy for a connection that never happened (ie calling party not responding), this does not work, probably there should be a timeout for this case, please look at https://github.com/Ayms/torrent-live/blob/master/freerider.js (seek for 'utp') and maybe the 'close' event should be let to the user and the internal 'close' event should be a '_close' event or something like this --> this.once('_close', function() {... this.emit('close',xx)...}

@mafintosh I put it in my PR todo list if you want.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Connection.prototype.end and inspect the existing tick, end, and close handling. Compare the utp usage in freerider.js, especially the destroy path for a connection that never completes. Done means the missing end behavior and the handling of end versus close are defined and verified for the non-responding connection case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.