April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Implementing a Client
n1. Create a Socket Object:
n client = new Socket( server, port_id );
n2. Create I/O streams for communicating with the server.
n is = new DataInputStream(client.getInputStream() );
n   os = new DataOutputStream( client.getOutputStream() );
n3. Perform I/O or communication with the server:
nReceive data from the server:
n String line = is.readLine();
nSend data to the server:
n os.writeBytes("Hello\n");
n4. Close the socket when done:   
n client.close();
n