Skip to content

Commit b923dad

Browse files
committed
ThroughputTest: Catch ClosedChannelException and ignore if necessary
Seen when emulating Linux on s390x, which may be very slow.
1 parent 5c1ec41 commit b923dad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

junixsocket-common/src/test/java/org/newsclub/net/unix/ThroughputTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ protected void acceptAndHandleConnection() throws IOException {
259259
sc.write(bb);
260260
bb.clear();
261261
}
262-
} catch (SocketException | SocketTimeoutException e) {
262+
} catch (SocketException | ClosedChannelException | SocketTimeoutException e) {
263263
if (keepRunning.get()) {
264264
throw e;
265265
} else {
@@ -599,7 +599,7 @@ public void run() {
599599
int written;
600600
try {
601601
written = dc.write(sendBuffer);
602-
} catch (SocketException e) {
602+
} catch (SocketException | ClosedChannelException | SocketTimeoutException e) {
603603
if (keepRunning.get()) {
604604
throw e;
605605
} else {

0 commit comments

Comments
 (0)