Code example for ServerSocket

Methods: getLocalSocketAddress

0
        }); 
        t.start();
    } 
 
    public InetSocketAddress getLocalSocketAddress() {
        return (InetSocketAddress) serverSocket.getLocalSocketAddress();
    } 
 
    public int getLocalPort() { 
        return serverSocket.getLocalPort();
    } 
 
    public void close() throws IOException { 
        serverSocket.close();
        for (Socket client : clients) {
            client.close();
        } 
    } 
}