33 public static void main( String[] args )
38 final int DEFALUT_PORT_NO = 40801 ;
39 int portNo = DEFALUT_PORT_NO ;
42 if( args.length != 2 )
44 System.out.println(
"Usage: java g4mini src_file server_hostname");
48 String server = args[1];
51 Socket socket =
new Socket( server, portNo ) ;
55 =
new BufferedReader (
new FileReader ( src ) ) ;
59 =
new BufferedWriter (
new OutputStreamWriter ( socket.getOutputStream() ) ) ;
63 while ( (line = br.readLine()) !=
null )
78 System.out.println( e.toString() );
static void main(String[] args)