public void run() {
		ArrayList<ClientThread> clientTheads = this.clientThreads; 

		try {
			/*
			 * Create input and output streams for this client.
			 */
			inputStream = new BufferedReader( new InputStreamReader(clientSocket.getInputStream()));
			outputStream = new PrintStream(clientSocket.getOutputStream());


			/*
			 * Messages
			 * 
			 */

			while(true){
				String inputHeader;
				String inputMessage;
				inputHeader = inputStream.readLine();
				inputMessage = inputStream.readLine();

				if(inputHeader!=null){
					if(inputHeader.equals(FINISHING_MESSAGE)){
						break;
					}
					System.out.println(inputHeader);
					if(inputMessage!=null){
						if (inputHeader.startsWith(MSG_ADD_TASK)){
							Gson gson = new Gson();
							Task task = gson.fromJson(inputMessage, Task.class);
							communicator.addTask(task);
							sendMessageToEveryOneExceptMe(MSG_ADD_TASK, inputMessage);
						}else if(inputHeader.startsWith(MSG_SYNC_ALL)){
							syncAllTasks(this);
						}
					}else{

					}
				}
			}

			/*
			 * Clean up. Set the current thread variable to null so that a new client
			 * could be accepted by the server.
			 */
			synchronized (this) {
				clientTheads.remove(this);
			}
			/*
			 * Close the output stream, close the input stream, close the socket.
			 */
			inputStream.close();
			outputStream.close();
			clientSocket.close();
		} catch (IOException e) {
		}
	}