Skip to content

Commit 5638499

Browse files
committed
test
1 parent 51f442d commit 5638499

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

OpenFlow/src/WebSocketServerClient.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,19 @@ export class WebSocketServerClient {
161161
public ping(): boolean {
162162
try {
163163
let msg: SocketMessage = SocketMessage.fromcommand("ping");
164-
if (this._socketObject.readyState === this._socketObject.CLOSED
165-
|| this._socketObject.readyState === this._socketObject.CLOSING) {
166-
this.CloseConsumers();
164+
var keys = Object.keys(this.queues);
165+
if (this._socketObject == null) {
166+
if (keys.length > 0) {
167+
this.CloseConsumers();
168+
return true;
169+
}
170+
return false;
171+
}
172+
if (this._socketObject.readyState === this._socketObject.CLOSED || this._socketObject.readyState === this._socketObject.CLOSING) {
173+
if (keys.length > 0) {
174+
this.CloseConsumers();
175+
return true;
176+
}
167177
return false;
168178
}
169179
this._socketObject.send(msg.tojson());
@@ -172,8 +182,13 @@ export class WebSocketServerClient {
172182
this._logger.error("WebSocketclient::WebSocket error encountered " + error);
173183
this._receiveQueue = [];
174184
this._sendQueue = [];
175-
this.CloseConsumers();
176-
return false;
185+
try {
186+
if (this._socketObject != null) {
187+
this._socketObject.close();
188+
}
189+
} catch (error) {
190+
}
191+
return true;
177192
}
178193
}
179194
private ProcessQueue(): void {

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openflow-nodered",
3-
"version": "1.0.63",
3+
"version": "1.0.64",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.63
1+
1.0.64

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openiap",
3-
"version": "1.0.63",
3+
"version": "1.0.64",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)