Skip to content

Commit e729443

Browse files
committed
common: test: Code cleanup
1 parent 85acd4c commit e729443

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public void testTCPLoopbackDirectBuffer() throws Exception {
6464
private void runTestTCPLoopback(boolean direct) throws Exception {
6565
final SocketAddress sa = new InetSocketAddress(InetAddress.getLoopbackAddress(), 0);
6666

67-
ServerSocketChannel ssc = ServerSocketChannel.open();
68-
69-
runTestSocketChannel("TCP-Loopback", sa, ssc, () -> SocketChannel.open(ssc.getLocalAddress()),
70-
direct);
67+
try (ServerSocketChannel ssc = ServerSocketChannel.open();
68+
SocketChannel sc = SocketChannel.open(ssc.getLocalAddress())) {
69+
runTestSocketChannel("TCP-Loopback", sa, ssc, () -> sc, direct);
70+
}
7171
}
7272

7373
@Test

0 commit comments

Comments
 (0)