TD2: Fix all important bugs in the object passing server and client
[TD_SR.git] / TD2 / server / BroadcastThreadService.java
index daf753f665ab16d9e798dcbc45428ce2b0732774..cd971c252356d34b4821c6e170ec81aa462d6c46 100644 (file)
@@ -34,6 +34,12 @@ public class BroadcastThreadService implements Runnable {
                }
        }
 
+       /**
+        * 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()));
@@ -44,7 +50,7 @@ public class BroadcastThreadService implements Runnable {
                        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);
                }