Skip to content

Commit

Permalink
[velux] force flush receive buffer
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Fiddian-Green <[email protected]>
  • Loading branch information
andrewfg committed Feb 28, 2021
1 parent 4083279 commit 2dc7f16
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ public Boolean call() throws Exception {
pollException = null;
slipMessageQueue.clear();

// loop forever or until internally or externally interrupted
while ((!interrupted) && (!Thread.interrupted())) {
// loop forever or until externally interrupted
while (!Thread.interrupted()) {
try {
if (interrupted) {
// fully flush the input buffer
inputStream.readAllBytes();
break;
}
byt = inputStream.read();
if (byt < 0) {
// end of stream is OK => keep on polling
Expand Down

1 comment on commit 2dc7f16

@gs4711
Copy link
Contributor

@gs4711 gs4711 commented on 2dc7f16 Feb 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not happy with the stability?

Please sign in to comment.