Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* @throws IOException [description]
*/
public void doService(Socket clientSocket, ArrayList<PrintWriter> sharedList) throws IOException {
+ PrintWriter OWriter = new PrintWriter(clientSocket.getOutputStream());
BufferedReader in;
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
- PrintWriter OWriter = new PrintWriter(clientSocket.getOutputStream());
sharedList.add(OWriter);
boolean end = false;
while (!end) {
broadcastMsg(theLine);
}
sharedList.remove(OWriter);
- if (in != null)
- in.close();
if (OWriter != null)
OWriter.close();
+ if (in != null)
+ in.close();
System.out.println("Fin du thread repondant au client, port "
+ clientSocket.getPort());
}
* @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());
+ ObjectInputStream OReader = new ObjectInputStream(clientSocket.getInputStream());
sharedList.add(OWriter);
boolean end = false;
while (!end) {
broadcastoMsg(roMsg);
}
sharedList.remove(OWriter);
- if (OReader != null)
- OReader.close();
if (OWriter != null)
OWriter.close();
+ if (OReader != null)
+ OReader.close();
System.out.println("Fin du thread repondant au client, port "
+ clientSocket.getPort());
}