Code example for ServerSocket

Methods: bind

0
    */ 
    // Skipped - it's answered the question, but might be needed later. 
    //@Test 
    public void testSocketBind() throws Exception { 
 
        ServerSocket socket = new ServerSocket();
        socket.bind(new InetSocketAddress(8080));
        String socketName = InetAddress.getLocalHost().getCanonicalHostName();
        assertEquals("socket name", "localhost:8080", socketName);
    } 
}