Skip to content

Commit

Permalink
0.2.5-0.0.1 - Fix: TCP Socket Wrapper (#48)
Browse files Browse the repository at this point in the history
* Fix tcp socket wrapper close handling

* Inc version
  • Loading branch information
lnbc1QWFyb24 authored Aug 17, 2023
1 parent 569ee23 commit 31fac6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lnmessage",
"version": "0.2.5",
"version": "0.2.5-0.0.1",
"description": "Talk to Lightning nodes from your browser",
"main": "dist/index.js",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions src/socket-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class SocketWrapper {

socket.on('close', () => {
this.onclose && this.onclose()
socket.removeAllListeners()
})

socket.on('error', (error) => {
Expand All @@ -32,8 +33,7 @@ class SocketWrapper {
}

this.close = () => {
socket.removeAllListeners()
socket.destroy()
socket.end()
}

const url = new URL(connection)
Expand Down

0 comments on commit 31fac6c

Please sign in to comment.