Commit 4bab21f0 authored by Claes Sjofors's avatar Claes Sjofors

Websocket server fix for erroneous subscriptions

parent 42923b6c
...@@ -140,8 +140,8 @@ public class GdhWebSocketServer ...@@ -140,8 +140,8 @@ public class GdhWebSocketServer
public final static int __IO_EXCEPTION = 2000; public final static int __IO_EXCEPTION = 2000;
public final static int __UNREFED = 0; public final static int __UNREFED = 0;
//static ArrayList<SubElement> subscriptions = new ArrayList<SubElement>(); static ArrayList<SubElement> subscriptions = new ArrayList<SubElement>();
static ArrayList subscriptions = new ArrayList(); //static ArrayList subscriptions = new ArrayList();
static int subscriptionCount = 0; static int subscriptionCount = 0;
...@@ -1144,7 +1144,7 @@ public class GdhWebSocketServer ...@@ -1144,7 +1144,7 @@ public class GdhWebSocketServer
for ( int i = 0; i < thSub.size(); i++) { for ( int i = 0; i < thSub.size(); i++) {
Sub asub = (Sub)thSub.elementAt(i); Sub asub = (Sub)thSub.elementAt(i);
if ( asub == null) if ( asub == null || asub.subscriptionsIndex == -1)
continue; continue;
switch( asub.typeId) { switch( asub.typeId) {
case Pwr.eType_Boolean: case Pwr.eType_Boolean:
...@@ -1248,7 +1248,7 @@ public class GdhWebSocketServer ...@@ -1248,7 +1248,7 @@ public class GdhWebSocketServer
j += 4; j += 4;
for ( int i = 0; i < thSub.size(); i++) { for ( int i = 0; i < thSub.size(); i++) {
Sub asub = (Sub)thSub.elementAt(i); Sub asub = (Sub)thSub.elementAt(i);
if ( asub == null || asub.subscriptionsIndex == -1) if ( asub == null || asub.subscriptionsIndex == -1)
continue; continue;
switch( asub.typeId) { switch( asub.typeId) {
case Pwr.eType_Boolean: case Pwr.eType_Boolean:
......
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