@soundworks/core 3.5.0 → 3.5.1
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.
- package/client/Socket.js +7 -1
- package/package.json +1 -1
package/client/Socket.js
CHANGED
|
@@ -119,6 +119,8 @@ class Socket {
|
|
|
119
119
|
|
|
120
120
|
const stringSocketUrl = `${url}?binary=0&${queryParams}`;
|
|
121
121
|
await new Promise((resolve, reject) => {
|
|
122
|
+
let connectionRefusedLogged = false;
|
|
123
|
+
|
|
122
124
|
const trySocket = async () => {
|
|
123
125
|
log(`[string socket] trying connection - url: ${stringSocketUrl}`);
|
|
124
126
|
const ws = new _isomorphicWs.default(stringSocketUrl, webSocketOptions);
|
|
@@ -145,7 +147,11 @@ class Socket {
|
|
|
145
147
|
|
|
146
148
|
ws.addEventListener('error', e => {
|
|
147
149
|
if (e.type === 'error' && e.error.code === 'ECONNREFUSED') {
|
|
148
|
-
|
|
150
|
+
if (!connectionRefusedLogged) {
|
|
151
|
+
console.log('[socket] connection refused, waiting for the server to start');
|
|
152
|
+
connectionRefusedLogged = true;
|
|
153
|
+
}
|
|
154
|
+
|
|
149
155
|
setTimeout(trySocket, 1000);
|
|
150
156
|
}
|
|
151
157
|
});
|