Handle broken pipe errors specifically
Since 9555d3a537a828731ad89ef5258ba537acf8cc11, a capture/encoding error was sometimes logged on exit.
This commit is contained in:
parent
0e473eb005
commit
5c3626ed47
@ -72,4 +72,8 @@ public final class IO {
|
||||
Throwable cause = e.getCause();
|
||||
return cause instanceof ErrnoException && ((ErrnoException) cause).errno == OsConstants.EPIPE;
|
||||
}
|
||||
|
||||
public static boolean isBrokenPipe(Exception e) {
|
||||
return e instanceof IOException && isBrokenPipe((IOException) e);
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +113,10 @@ public class SurfaceEncoder implements AsyncProcessor {
|
||||
alive = !stopped.get() && !capture.isClosed();
|
||||
}
|
||||
} catch (IllegalStateException | IllegalArgumentException | IOException e) {
|
||||
if (IO.isBrokenPipe(e)) {
|
||||
// Do not retry on broken pipe, which is expected on close because the socket is closed by the client
|
||||
throw e;
|
||||
}
|
||||
Ln.e("Capture/encoding error: " + e.getClass().getName() + ": " + e.getMessage());
|
||||
if (!prepareRetry(size)) {
|
||||
throw e;
|
||||
|
Loading…
x
Reference in New Issue
Block a user