try {
doService(clientSocket, listoWriter);
clientSocket.close();
- } catch (IOException e) {
+ }
+ catch (IOException e) {
System.err.println("IOException : " + e);
e.printStackTrace();
}
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());