We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e62589 commit 1052c1fCopy full SHA for 1052c1f
src/core/Ros.js
@@ -69,8 +69,10 @@ Ros.prototype.connect = function(url) {
69
this.socket.on('error', this.socket.onerror);
70
} else if (this.transportLibrary.constructor.name === 'RTCPeerConnection') {
71
this.socket = assign(this.transportLibrary.createDataChannel(url, this.transportOptions), socketAdapter(this));
72
- }else {
73
- this.socket = assign(new WebSocket(url), socketAdapter(this));
+ } else {
+ if (!this.socket || this.socket.readyState === WebSocket.CLOSED) {
74
+ this.socket = assign(new WebSocket(url), socketAdapter(this));
75
+ }
76
}
77
78
};
0 commit comments