Skip to content

Commit

Permalink
Destroy socket on client close (#250)
Browse files Browse the repository at this point in the history
* Destroy socket on client close

* Only use destroy, not end and destroy both

* Update npm install process
  • Loading branch information
martijnimhoff authored Feb 27, 2024
1 parent 6db253f commit 1087e4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
temp
dist
.vscode
.vscode
.idea
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"scripts": {
"prepublishOnly": "npm run clean && npm run lint && tsc && mocha",
"prepare": "tsc",
"test": "npm run prepublishOnly",
"clean": "rm -rf dist",
"lint": "eslint \"./src/**/*.ts\"",
Expand Down
4 changes: 1 addition & 3 deletions src/FtpContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,7 @@ export class FTPContext {
if (socket) {
this._removeSocketListeners(socket)
socket.on("error", doNothing)
socket.on("timeout", () => socket.destroy())
socket.setTimeout(this.timeout)
socket.end()
socket.destroy()
}
}

Expand Down

0 comments on commit 1087e4b

Please sign in to comment.