()
| 78 | } |
| 79 | |
| 80 | public void finalize() |
| 81 | { |
| 82 | String message = NetworkProtocol.DISCONNECT+""; |
| 83 | sendMessageAll(message); |
| 84 | |
| 85 | ListIterator<ClientConnection> itr = clients.listIterator(); |
| 86 | |
| 87 | while(itr.hasNext()) |
| 88 | { |
| 89 | ClientConnection client = itr.next(); |
| 90 | |
| 91 | client.disconnect(); |
| 92 | } |
| 93 | |
| 94 | acceptingConnections = false; |
| 95 | try |
| 96 | { |
| 97 | serverSocket.close(); |
| 98 | } |
| 99 | catch (IOException e) |
| 100 | { |
| 101 | e.printStackTrace(); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | public synchronized void addClient(Socket socket) |
| 106 | { |
no test coverage detected