Skip to content

Commit 4e06df5

Browse files
committed
close stream when ioException catched on readers side. Make status clear and helps ASAPAndroid manage its connection lists.
1 parent 0175511 commit 4e06df5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/net/sharksystem/asap/protocol/ASAPPersistentConnection.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,15 @@ public void run() {
425425
this.asapPDU = protocol.readPDU(is);
426426
} catch (IOException e) {
427427
this.ioException = e;
428+
System.out.println(ASAPPersistentConnection.this.getLogStart()
429+
+ "ioException when reading from stream, close stream");
430+
try {
431+
this.is.close();
432+
} catch (IOException exception) {
433+
System.out.println(ASAPPersistentConnection.this.getLogStart()
434+
+ "closing a stream we could not read from: "
435+
+ exception.getLocalizedMessage());
436+
}
428437
} catch (ASAPException e) {
429438
this.asapException = e;
430439
}

0 commit comments

Comments
 (0)