hi
this is the most complicated try block i have ever seen
actually i am struggling to understand it
there is a while loop inside another while loop !!!
try {
ServerSocket ss= new ServerSocket(2000);
while(true){
Socket s=ss.accept();
connectionCount++;
System.out.println("Connection "+connectionCount+" made");
is=s.getInputStream();
os=s.getOutputStream();
pw=new PrintWriter(os,true);
br=new BufferedReader(new InputStreamReader(is));
System.out.println("System set up");
//Read and process names until the client tells the server
//the sevice is no longer required.
lineRead="";
while(true){
lineRead=br.readLine();
if(lineRead.equals("Exit")) break;
o=names.get(lineRead);
if(o==null) reply="User not known";
else reply=(String)o;
pw.println(reply);
}
pw.close();
br.close();
is.close();
os.close();
System.out.println("Closed down");
}
}
catch(IOException e){
System.out.println("Trouble with connection"+e);
}