Coding style cleanups.
[TD_SR.git] / TD2 / server / BroadcastoThreadService.java
index e8a3622a2d53a7396a8877b22b6830dc7769b661..5ade5f328d87c830acc03a741e6eac18c880b3ef 100644 (file)
@@ -19,7 +19,8 @@ public class BroadcastoThreadService implements Runnable {
                try {
                        doService(clientSocket, listoWriter);
                        clientSocket.close();
-               } catch (IOException e) {
+               }
+               catch (IOException e) {
                        System.err.println("IOException : " + e);
                        e.printStackTrace();
                }
@@ -31,13 +32,21 @@ public class BroadcastoThreadService implements Runnable {
                        try {
                                if (this.clientSocket != null)
                                        this.clientSocket.close();
-                       } catch (IOException e) {
+                       }
+                       catch (IOException e) {
                                System.err.println("IOException : " + e);
                                e.printStackTrace();
                        }
                }
        }
 
+       /**
+        * Be careful, this function must be thread-safe
+        * @param  clientSocket           [description]
+        * @param  sharedList             [description]
+        * @throws IOException            [description]
+        * @throws ClassNotFoundException [description]
+        */
        public void doService(Socket clientSocket, ArrayList<ObjectOutputStream> sharedList) throws IOException, ClassNotFoundException {
                ObjectInputStream OReader = new ObjectInputStream(clientSocket.getInputStream());
                ObjectOutputStream OWriter = new ObjectOutputStream(clientSocket.getOutputStream());