Commit 2709206d authored by yann300's avatar yann300 Committed by ioedeveloper

check websocket connection

parent 08c01ae2
...@@ -70,6 +70,17 @@ export class RemixdHandle extends WebsocketPlugin { ...@@ -70,6 +70,17 @@ export class RemixdHandle extends WebsocketPlugin {
) )
this.canceled() this.canceled()
} else { } else {
const intervalId = setInterval(() => {
if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed
clearInterval(intervalId)
console.log(error)
modalDialogCustom.alert(
'Connection to remixd terminated' +
'Please make sure remixd is still running in the background.'
)
this.canceled()
}
}, 3000)
this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot()) this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot())
} }
} }
...@@ -85,7 +96,7 @@ export class RemixdHandle extends WebsocketPlugin { ...@@ -85,7 +96,7 @@ export class RemixdHandle extends WebsocketPlugin {
try { try {
super.activate() super.activate()
setTimeout(() => { setTimeout(() => {
if (!this.socket) { if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed
connection(new Error('Connection with daemon failed.')) connection(new Error('Connection with daemon failed.'))
} else { } else {
connection() connection()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment