@live-change/dao-websocket 0.5.18 → 0.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,11 +11,11 @@ class WebSocketConnection extends Connection {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
initialize() {
|
|
14
|
-
debug("connecting...")
|
|
14
|
+
debug("connecting", this.url, "...")
|
|
15
15
|
this.connection = new WebSocket(this.url, "reactive-observer", this.settings)
|
|
16
16
|
let connection = this.connection
|
|
17
17
|
connection.onopen = (function () {
|
|
18
|
-
debug("connection open")
|
|
18
|
+
debug("connection", this.url, "open")
|
|
19
19
|
if (connection.readyState === WebSocket.CONNECTING) return setTimeout(connection.onopen, 230)
|
|
20
20
|
this.handleConnect()
|
|
21
21
|
}).bind(this)
|
|
@@ -30,7 +30,7 @@ class WebSocketConnection extends Connection {
|
|
|
30
30
|
this.handleDisconnect()
|
|
31
31
|
}
|
|
32
32
|
connection.onclose = (function () {
|
|
33
|
-
debug("connection close")
|
|
33
|
+
debug("connection", this.url, " close")
|
|
34
34
|
disconnect()
|
|
35
35
|
}).bind(this)
|
|
36
36
|
connection.onmessage = (function (e) {
|
|
@@ -39,7 +39,7 @@ class WebSocketConnection extends Connection {
|
|
|
39
39
|
this.handleMessage(message)
|
|
40
40
|
}).bind(this)
|
|
41
41
|
connection.onerror = (function(err) {
|
|
42
|
-
debug("connection error", err.message)
|
|
42
|
+
debug("connection", this.url, "error", err.message)
|
|
43
43
|
disconnect()
|
|
44
44
|
})
|
|
45
45
|
}
|
|
@@ -51,14 +51,14 @@ class WebSocketConnection extends Connection {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
reconnect() {
|
|
54
|
-
debug("reconnect")
|
|
54
|
+
debug("reconnect", this.url)
|
|
55
55
|
this.connection.close()
|
|
56
56
|
if (this.autoReconnect) return;
|
|
57
57
|
this.initialize()
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
dispose() {
|
|
61
|
-
debug("close")
|
|
61
|
+
debug("close", this.url)
|
|
62
62
|
super.dispose()
|
|
63
63
|
this.connection.close()
|
|
64
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/dao-websocket",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.20",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "m8@em8.pl",
|
|
6
6
|
"name": "Michał Łaszczewski",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/live-change/live-change-dao/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@live-change/dao": "^0.5.
|
|
13
|
+
"@live-change/dao": "^0.5.20",
|
|
14
14
|
"bufferutil": "^4.0.3",
|
|
15
15
|
"debug": "^4.3.4",
|
|
16
16
|
"supports-color": "^7.2.0",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"compileTests": "webpack test/*.js tests-bundle.js"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "36b21b0f5615098306e92ac4b05013f859268efe"
|
|
45
45
|
}
|