mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
a somewhat more robust way of closing and reconnecting to Igtimi WebSocket servers;
ignore the onWebSocketClose event if it is caused by the reconnect() call Change-Id: I0b735d17168855e66ade684f5953a1faaa8e82e4
This commit is contained in:
1 parent
b5b74b8982
commit
b884ad9677
2 files changed
+76
-43
No files matched your search
+6
-4
@@ -248,13 +248,15 @@ public abstract class WindStatusServlet extends SailingServerHttpServlet impleme
|
||||
@Override
|
||||
public void windDataReceived(Wind wind, String deviceSerialNumber) {
|
||||
Deque<IgtimiMessageInfo> messagesPerDevice = lastIgtimiMessages.get(deviceSerialNumber);
|
||||
if(messagesPerDevice == null) {
|
||||
if (messagesPerDevice == null) {
|
||||
messagesPerDevice = new ArrayDeque<IgtimiMessageInfo>(NUMBER_OF_MESSAGES_PER_DEVICE_TO_SHOW);
|
||||
lastIgtimiMessages.put(deviceSerialNumber, messagesPerDevice);
|
||||
}
|
||||
messagesPerDevice.addFirst(new IgtimiMessageInfo(wind));
|
||||
if(messagesPerDevice.size() > NUMBER_OF_MESSAGES_PER_DEVICE_TO_SHOW) {
|
||||
messagesPerDevice.pollLast();
|
||||
synchronized (messagesPerDevice) {
|
||||
messagesPerDevice.addFirst(new IgtimiMessageInfo(wind));
|
||||
if (messagesPerDevice.size() > NUMBER_OF_MESSAGES_PER_DEVICE_TO_SHOW) {
|
||||
messagesPerDevice.pollLast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user