Skip to content

Commit

Permalink
Pinger.kt: break out of the correct loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarning committed Jan 29, 2023
1 parent 5e49680 commit d5ea712
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/kotlin/d/d/meshenger/call/Pinger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ class Pinger(val binder: MainService.MainBinder, val contacts: List<Contact>) :
try {
socket.connect(address, connectTimeout)
connected = true
break
} catch (e: ConnectException) {
// target online, but Meshenger not running
return Contact.State.APP_NOT_RUNNING
} catch (e: Exception) {
// ignore
}
}

if (connected) {
break
}
}

if (!connected) {
Expand Down

0 comments on commit d5ea712

Please sign in to comment.