@Override
	public void processConnection() {
		while (true) {
			try {
				int command = (Integer) input.readObject();

				switch (command) {
				case ALL_LIST:
					updateAllUserList();
					System.out.println("Update found from "
							+ connection.getPort() + " in "
							+ connection.getLocalPort());
					break;
				case READY:
					SendFile sendFile = new SendFile(fileServerIP, fileServerPort, 
							(ClientGUI) userInterface);
					Thread fileSendThread = new Thread(sendFile);
					fileSendThread.start();
					break;
				case RECEIVE_FILE:
					RecieveFile recieveFile = new RecieveFile(fileServerIP, fileServerPort, 
							(ClientGUI) userInterface);
					Thread fileRecieveThread = new Thread(recieveFile);
					fileRecieveThread.start();
					sendData(READY);
					break;
				case CANCEL:
					JOptionPane.showMessageDialog(null, "File sending refused");
					break;
				}
			} catch (ClassNotFoundException classNotFoundException) {
				userInterface.displayErrorMessage("Unknown object type received");
			} catch (IOException ioException) {
				userInterface.displayErrorMessage("Server terminated connection");
				closeConnection();
			}
		}
	}