mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/base/TestSocketChannel.java
@Test
    public void testMultiConnect() throws UnknownHostException, IOException
    {
        // verify can make connection
        try (Socket socket = SocketHostHelper.connectToController())
        {
            // verify can make multiple connections
            try (Socket socket2 = SocketHostHelper.connectToController())
            {
                try (Socket socket3 = SocketHostHelper.connectToController())
                {
                    // verify each socket is actually a different connection
                    assertThat(socket.getLocalPort(), is(not(socket2.getLocalPort())));
                    assertThat(socket.getLocalPort(), is(not(socket3.getLocalPort())));
                    assertThat(socket2.getLocalPort(), is(not(socket3.getLocalPort())));
                }
            }
        }
    }
/**
     * Verify connection can be made to the default port for sockets.
     * Verify multiple connections can be made at once.
     */
Verify connection can be made to the default port for sockets.
Verify multiple connections can be made at once.
Verify connection can be made to the default port for sockets . Verify multiple connections can be made at once .
@Test
    public void testMultiConnect() throws UnknownHostException, IOException
    {
        try (Socket socket = SocketHostHelper.connectToController())
        {
            try (Socket socket2 = SocketHostHelper.connectToController())
            {
                try (Socket socket3 = SocketHostHelper.connectToController())
                {
                    assertThat(socket.getLocalPort(), is(not(socket2.getLocalPort())));
                    assertThat(socket.getLocalPort(), is(not(socket3.getLocalPort())));
                    assertThat(socket2.getLocalPort(), is(not(socket3.getLocalPort())));
                }
            }
        }
    }
@ Test public void testMultiConnect ( ) throws UnknownHostException , IOException { try ( Socket socket = SocketHostHelper . connectToController ( ) ) { try ( Socket socket2 = SocketHostHelper . connectToController ( ) ) { try ( Socket socket3 = SocketHostHelper . connectToController ( ) ) { assertThat ( socket . getLocalPort ( ) , is ( not ( socket2 . getLocalPort ( ) ) ) ) ; assertThat ( socket . getLocalPort ( ) , is ( not ( socket3 . getLocalPort ( ) ) ) ) ; assertThat ( socket2 . getLocalPort ( ) , is ( not ( socket3 . getLocalPort ( ) ) ) ) ; } } } }
Verify connection can be made to the default port for sockets.
Verify connection can be made to the default port for sockets .
// verify can make connection // verify can make multiple connections // verify each socket is actually a different connection