}
}
+ /**
+ * Be careful, this function must be thread-safe
+ * @param clientSocket [description]
+ * @param sharedList [description]
+ * @throws IOException [description]
+ */
public void doService(Socket clientSocket, ArrayList<PrintWriter> sharedList) throws IOException {
BufferedReader in;
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String theLine = in.readLine();
if (theLine.equals(".")) {
end = true; // le thread de service doit terminer
- break; // do not broadcast the dot that will close clients threads
+ break; // do not broadcast the dot that will close all clients threads
}
broadcastMsg(theLine);
}