Show More
@@ -355,11 +355,18 define([ | |||
|
355 | 355 | * @method stop_channels |
|
356 | 356 | */ |
|
357 | 357 | Kernel.prototype.stop_channels = function () { |
|
358 | var that = this; | |
|
359 | var close = function (c) { | |
|
360 | return function () { | |
|
361 | if (that.channels[c].readyState === WebSocket.CLOSED) { | |
|
362 | that.channels[c] = null; | |
|
363 | } | |
|
364 | }; | |
|
365 | }; | |
|
358 | 366 | for (var c in this.channels) { |
|
359 | 367 | if ( this.channels[c] !== null ) { |
|
360 |
this.channels[c].onclose = |
|
|
368 | this.channels[c].onclose = close(c); | |
|
361 | 369 | this.channels[c].close(); |
|
362 | this.channels[c] = null; | |
|
363 | 370 | } |
|
364 | 371 | } |
|
365 | 372 | }; |
@@ -379,6 +386,15 define([ | |||
|
379 | 386 | return true; |
|
380 | 387 | }; |
|
381 | 388 | |
|
389 | Kernel.prototype.is_fully_disconnected = function () { | |
|
390 | for (var c in this.channels) { | |
|
391 | if (this.channels[c] === null) { | |
|
392 | return true; | |
|
393 | } | |
|
394 | } | |
|
395 | return false; | |
|
396 | }; | |
|
397 | ||
|
382 | 398 | // send a message on the Kernel's shell channel |
|
383 | 399 | Kernel.prototype.send_shell_message = function (msg_type, content, callbacks, metadata) { |
|
384 | 400 | if (!this.is_connected()) { |
General Comments 0
You need to be logged in to leave comments.
Login now