public NexTClient(){

	// The default port

	int port_number=2222;
        String host="localhost";

	// Initialization section:
	// Try to open a socket on a given host and port
	// Try to open input and output streams
	try {
            clientSocket = new Socket(host, port_number);
            inputLine = new BufferedReader(new InputStreamReader(System.in));
            os = new PrintStream(clientSocket.getOutputStream());
            is = new DataInputStream(clientSocket.getInputStream());
        } catch (UnknownHostException e) {
            System.err.println("Don't know about host "+host);
        } catch (IOException e) {
            System.err.println("Couldn't get I/O for the connection to the host "+host);
        }

	// If everything has been initialized then we want to write some data
	// to the socket we have opened a connection to on port port_number

        if (clientSocket != null && os != null && is != null) {
            try {

		// Create a thread to read from the server

                new Thread(new NexTClient()).start();

		while (!closed) {
                    os.println(inputLine.readLine());
                }

		// Clean up:
		// close the output stream
		// close the input stream
		// close the socket

		os.close();
		is.close();
		clientSocket.close();
            } catch (IOException e) {
                System.err.println("IOException:  " + e);
            }
        }
    }