Skip to content

Commit

Permalink
command getData while true null
Browse files Browse the repository at this point in the history
  • Loading branch information
javray committed Oct 24, 2014
1 parent 05e8228 commit fe6b6de
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/android/Mikrotik.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,20 @@ else if (action.equals("command")) {

if (res.equals("Sent successfully")) {
res = "";
try {
while (!(result = this.aConn.getData()).equals("")) {
res += result;
}
while (true) {
try {
res = this.aConn.getData();
if (res != null) {
result += res;
if (res.contains("!done")) {
break;
}
}
} catch (InterruptedException ex) {
callbackContext.error("No Data: " + ex.toString());
}
}
catch (InterruptedException e) {
callbackContext.error("No Data: " + e.toString());
return false;
}
callbackContext.success(res);
callbackContext.success(result);
}
else {
callbackContext.error(res);
Expand Down

0 comments on commit fe6b6de

Please sign in to comment.