public void startServer() throws IOException
    {
        ServerSocket ss = new ServerSocket(portNum);
        while(true)
        {
            Socket s = ss.accept();
            Thread t = new Thread(new ConnectionHandler(s));
            t.start();
        }
    }