Fixed socket calls.
This commit is contained in:
@ -137,13 +137,13 @@ CodeOceanEditorEvaluation = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
killWebsocketAndContainer: function () {
|
killWebsocketAndContainer: function () {
|
||||||
if (this.websocket.readyState != WebSocket.OPEN) {
|
if (this.websocket.getReadyState() != WebSocket.OPEN) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.websocket.send(JSON.stringify({cmd: 'exit'}));
|
this.websocket.send(JSON.stringify({cmd: 'exit'}));
|
||||||
this.websocket.flush();
|
this.websocket.killWebSocket();
|
||||||
this.websocket.close();
|
|
||||||
this.hideSpinner();
|
this.hideSpinner();
|
||||||
this.running = false;
|
this.running = false;
|
||||||
this.toggleButtonStates();
|
this.toggleButtonStates();
|
||||||
|
@ -88,3 +88,18 @@ CommandSocket.prototype.executeCommand = function(cmd) {
|
|||||||
CommandSocket.prototype.send = function(data) {
|
CommandSocket.prototype.send = function(data) {
|
||||||
this.websocket.send(data);
|
this.websocket.send(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the ready state of the socket.
|
||||||
|
*/
|
||||||
|
CommandSocket.prototype.getReadyState = function() {
|
||||||
|
return this.websocket.readyState;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the websocket.
|
||||||
|
*/
|
||||||
|
CommandSocket.prototype.killWebSocket = function() {
|
||||||
|
this.websocket.flush();
|
||||||
|
this.websocket.close();
|
||||||
|
};
|
Reference in New Issue
Block a user