void acceptConnection() throws IOException {
        clientSocket = serverSocket.accept();
        out = new PrintWriter(clientSocket.getOutputStream(), true);
        in = new BufferedReader(new InputStreamReader(
                clientSocket.getInputStream()));
        out.println("welcome"); // welcome client
        if (out.checkError()) {
            throw (new IOException());
        }
    }