Skip to content

Commit ac25d8a

Browse files
author
Aaron
committed
Misc
1 parent d7910ba commit ac25d8a

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ subprojects {
44
apply plugin: 'maven'
55

66
group 'org.iot-dsa'
7-
version '0.31.0'
7+
version '0.31.1'
88

99
sourceCompatibility = 1.6
1010
targetCompatibility = 1.6

dslink-v2/src/main/java/com/acuity/iot/dsa/dslink/protocol/DSSession.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ protected void setAckToSend(int ackToSend) {
336336
}
337337

338338
protected boolean waitingForAcks() {
339-
return getMissingAcks() > 8;
339+
boolean ret = getMissingAcks() > 8;
340+
if (ret) {
341+
debug(debug() ? "Waiting for " + getMissingAcks() + " acks" : null);
342+
}
343+
return ret;
340344
}
341345

342346
///////////////////////////////////////////////////////////////////////////

dslink-v2/src/main/java/com/acuity/iot/dsa/dslink/protocol/responder/DSInboundSubscription.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,11 @@ protected DSInboundSubscription(DSInboundSubscriptions manager,
6969
public boolean canWrite(DSSession session) {
7070
if (ackRequired > 0) {
7171
int last = session.getAckRcvd();
72-
if (last > ackRequired) {
72+
if (last >= ackRequired) {
7373
return true;
7474
}
7575
//is the last ack is so far away that we have a rollover.
76-
boolean b = ((ackRequired - 10000000) > last);
77-
//if (!b) { //TODO
78-
//System.out.print('.');
79-
//}
80-
return b;
76+
return ((ackRequired - 10000000) > last);
8177
}
8278
return true;
8379
}
@@ -232,15 +228,17 @@ protected void write(DSSession session, MessageWriter writer, StringBuilder buf)
232228
ackRequired = session.getMessageId();
233229
}
234230
Update update = dequeue();
235-
int count = 0;
231+
int count = 500;
236232
while (update != null) {
237233
write(update, writer, buf);
238234
if ((qos == 0) || session.shouldEndMessage()) {
239235
break;
240-
} else if (++count > 1024) {
241-
break;
242236
}
243-
update = dequeue();
237+
if (--count >= 0) {
238+
update = dequeue();
239+
} else {
240+
update = null;
241+
}
244242
}
245243
synchronized (this) {
246244
if (updateHead == null) {

dslink-v2/src/main/java/com/acuity/iot/dsa/dslink/protocol/v1/DS1ConnectionInit.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public class DS1ConnectionInit extends DSNode {
2929
///////////////////////////////////////////////////////////////////////////
3030

3131
private static final String DSA_VERSION = "1.1.2";
32-
private static final String[] SUPPORTED_FORMATS = new String[]{"msgpack", "json"};
33-
//private static final String[] SUPPORTED_FORMATS = new String[]{"json"};
32+
//private static final String[] SUPPORTED_FORMATS = new String[]{"msgpack", "json"};
33+
private static final String[] SUPPORTED_FORMATS = new String[]{"json"};
3434

3535
private String BROKER_REQ = "Broker Request";
3636
private String BROKER_RES = "Broker Response";

0 commit comments

Comments
 (0)