Example

try {
  ServerSocket ss = new ServerSocket(2345);
  Socket s = ss.accept();
  PrintWriter pw = new 
  PrintWriter(s.getOutputStream());
  pw.println("Hello There!");
  pw.println("Goodbye now.");
  s.close();
}
catch (IOException e) {
  System.err.println(e);
}

Previous | Next | Top | Cafe con Leche

Copyright 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified July 14, 2000