import java.net.*; import java.io.*; // http://java.sun.com/j2se/1.3/docs/api/java/net/Socket.html // http://java.sun.com/j2se/1.3/docs/api/java/net/ServerSocket.html public class Server { public static void main(String[] args) throws IOException { // ### Open server socket listening at 8080 ServerSocket s = ... ; while ( true ) { // ### wait for connection Socket channel = ... ; System.out.println(""); InputStream in = channel.getInputStream(); DataInputStream din = new DataInputStream(in); // ### read line of input String line = ... ; while ( line!=null ) { System.out.println(line); // ### read line of input line = ... ; } // ### close input stream, channel to client System.out.println(""); } } }