Minor documentation inputs / changes
This commit is contained in:
parent
fd8ee64e50
commit
69219bc120
@ -110,7 +110,6 @@ public class Client {
|
||||
public void closeEverything(Socket socket, BufferedReader in, BufferedWriter out) {
|
||||
//TODO Correctly closing a clients connection
|
||||
|
||||
// Is this not already correct?
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
|
||||
@ -126,8 +126,6 @@ public class ClientHandler implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Documentation
|
||||
|
||||
/** Sends a given message to client
|
||||
*
|
||||
* @param msg the given message
|
||||
|
||||
@ -30,17 +30,13 @@ public class Server {
|
||||
connectedClients.add(nextClient);
|
||||
th.start();
|
||||
// close socket + remove client if client is disconnected
|
||||
if (socket.getInputStream().read() == -1) {
|
||||
/* TODO: Modify or remove this disconnection handling - right now, it is not functioning
|
||||
(when disconnecting there are "broken pipe" exceptions on client side and "stream closed"
|
||||
exceptions on the server side).
|
||||
*/
|
||||
if (nextClient.getSocket().getInputStream().read() == -1) {
|
||||
System.out.println("client disconnected. closing socket");
|
||||
socket.close();
|
||||
connectedClients.remove(nextClient);
|
||||
}
|
||||
|
||||
// close socket + remove client if client is disconnected
|
||||
if (socket.getInputStream().read() == -1) {
|
||||
System.out.println("client disconnected. closing socket");
|
||||
socket.close();
|
||||
connectedClients.remove(nextClient);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user