Esempio n. 1
0
  public void run() {
    if (clientSocket == null) {
      return;
    }

    PrintStream out = null;

    Utilities.printMsg("creating output stream");

    try {
      out = new PrintStream(clientSocket.getOutputStream());
    } catch (IOException e) {
      System.err.println("Error binding output to socket, " + e);
      System.exit(1);
    }

    Utilities.printMsg("writing current date");

    Date d = new Date();
    out.println(d);

    try {
      out.close();
      clientSocket.close();
    } catch (IOException e) {
    }
  }