Loading src/test/java/ch15/ConceptsTest.java +12 −0 Changes for src/test/java/ch15/ConceptsTest.java: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -33,6 +33,18 @@ class ConceptsTest { Socket socket = new Socket("localhost", 4242); } @Test void testChannelPortNumbers() throws IOException { SocketAddress serverAddress = new InetSocketAddress("127.0.0.1", 3601); ServerSocketChannel serverSocketChannel = ServerSocketChannel.open(); serverSocketChannel.bind(serverAddress); SocketChannel client1 = SocketChannel.open(serverAddress); System.out.println("client1.getRemoteAddress() = " + client1.getRemoteAddress()); SocketChannel client2 = SocketChannel.open(serverAddress); System.out.println("client2.getRemoteAddress() = " + client2.getRemoteAddress()); } @Test void testBlockingVsNonBlocking() throws IOException { int serverPort = 3600; Loading Loading
src/test/java/ch15/ConceptsTest.java +12 −0 Changes for src/test/java/ch15/ConceptsTest.java: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -33,6 +33,18 @@ class ConceptsTest { Socket socket = new Socket("localhost", 4242); } @Test void testChannelPortNumbers() throws IOException { SocketAddress serverAddress = new InetSocketAddress("127.0.0.1", 3601); ServerSocketChannel serverSocketChannel = ServerSocketChannel.open(); serverSocketChannel.bind(serverAddress); SocketChannel client1 = SocketChannel.open(serverAddress); System.out.println("client1.getRemoteAddress() = " + client1.getRemoteAddress()); SocketChannel client2 = SocketChannel.open(serverAddress); System.out.println("client2.getRemoteAddress() = " + client2.getRemoteAddress()); } @Test void testBlockingVsNonBlocking() throws IOException { int serverPort = 3600; Loading