Only log the exception when unexpected
The socket is closed in another thread to stop the transmission. That causes an exception, but that is the expected behaviour, so do not log it.
This commit is contained in:
@@ -167,9 +167,11 @@ public class MonitorService extends Service {
|
||||
serviceConnection(socket);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Just in case
|
||||
currentPort++;
|
||||
Log.e(TAG, "Failed to open server socket. Port increased to " + currentPort, e);
|
||||
if (Objects.equals(connectionToken, currentToken)) {
|
||||
// Just in case
|
||||
currentPort++;
|
||||
Log.e(TAG, "Failed to open server socket. Port increased to " + currentPort, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user