import java.net.*;
import java.io.* ;

class client{

  private static int SERVER_PORT = 5432 ;
  private static int MAX_LINE = 256 ;

  public static void main (String args[]) {

    String host = "";
    Socket s = null;

    if (args.length == 1) {
      host = args[0] ;
    }
    else {
      System.err.println("usage: java client host") ;
      System.exit(1) ;
    }

    try {
      s = new Socket(host, SERVER_PORT) ;
      byte[] buf = new byte[MAX_LINE] ;
      int rc ;
      while ((rc=System.in.read(buf)) > 0)
      {
        s.getOutputStream().write(buf, 0, rc) ;
      }
    } catch ( IOException ioe ) {
      System.out.println("Some I/O error happened") ;
      System.exit(1) ;
    }
  }
}
