import java.net.*;
import java.io.*;
class client {
public static void main( String [] args ) throws IOException {
System.out.println("connecting...");
Socket s = new Socket("pcpat", 1234);
new PrintStream( s.getOutputStream() ).println("GET /foo.html");
DataInputStream bin = new DataInputStream( s.getInputStream() );
//BufferedRead bin = new BufferedReader( s.getInputStream() );
String line;
while ( (line = bin.readLine()) != null )
System.out.println(line);
}
}
|