import java.net.*;
import java.io.*;

public class Net1 {
	public static void main(String argv[]) {
		ServerSocket servSock1 = null;
		Socket sock1 = null;
		InputStream in = null;
		InputStreamReader isr = null;
		
		try {
			servSock1 = new ServerSocket(80);
			sock1 = servSock1.accept();
			in = sock1.getInputStream();
			isr = new InputStreamReader(in);

			int c; 
			while ( (c = isr.read()) != -1 ) {
				System.out.print((char) c);
			} //while
		} catch (IOException io) {
			System.out.println("an IOException occurred\n"+io.toString()+"\n"+io.getMessage() );
		} //catch		
	} //main()
} //class Net1