import java.io.*; import java.net.*; /** * Copyright (c) 2000, 2001 Timothy W Macinta, All Rights Reserved.

* * @author Tim Macinta (twm@alum.mit.edu) **/ public class TimeoutTestServer { public static void main(String arg[]) { try { int portnum; if (arg.length > 0) portnum = Integer.parseInt(arg[0]); else portnum = 80; ServerSocket ss = new ServerSocket(portnum); while(true) { Socket sock = ss.accept(); InputStream in = sock.getInputStream(); int c; while ((c = in.read()) >= 0) { System.out.print((char) c); System.out.flush(); } sock.close(); } } catch (Exception e) { e.printStackTrace(); } } }