Outubro 2008
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Time-Of-Day Server/Client
nServer uses ServerSocket to Create the Socket on Port 5155
n  ServerSocket s = new ServerSocket(5155);
nTo Accept Connections From Clients:
n Socket client = s.accept();
nConnections are Often Serviced in Separate Threads
nThe Client Connects to the Server Using Socket class with the IP Address of the Server.
n Socket s = new Socket(“127.0.0.1”,5155);
n
n