Skip to content

Commit

Permalink
Properly handle disconnections
Browse files Browse the repository at this point in the history
  • Loading branch information
ybizeul committed Nov 23, 2020
1 parent 02b0f25 commit 4293014
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Name": "WebSocket Proxy",
"Icon": "images/websocket",
"SDKVersion": 2,
"Version": "1.1",
"Version": "1.1.1",
"PropertyInspectorPath": "plugin/inspector.html",
"OS": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function connect(coordinates,remoteServer,message) {
connections[key]=c

// send willAppear message when connection is ready
c.onopen = function() {
c.onopen = function(evt) {
console.log("Remote socket opened")
if (message) {
c.send(JSON.stringify(message))
Expand Down Expand Up @@ -51,7 +51,7 @@ function disconnect(coordinates,message) {
if (c.readyState == 1) {
c.send(JSON.stringify(message))
}
connections.delete(key)
delete connections[key]
c.close()
}
}
Expand Down

0 comments on commit 4293014

Please sign in to comment.