@Override
	public void run() {
		
		Start.display("Initialized loop for " + this.getTempAlias());
		
		// Run the loop while it's still open.
		boolean running = true;
		while (running) {
			
			String message;
			
			try {
				message = (String) input.readObject();
				if (CommandFormat.isCommand(message)) {
					CommandHandler.onCommandReceived(this.identifier, message);
				} else {
					Start.display(alias + ": " + message);
				}	
			}
			
			catch (ClassNotFoundException e) {
				break;
			} catch (IOException e) {
				if (socket.isClosed()) {
					break;
				}
				Start.display("Can not read the streams (" + e.toString() + ").");
				break;
			}		
			
		}
		
		// Remove the connection from the handler.
		Start.display(this.getTempAlias() + " disconnected");
		Start.connectionHnd.remove(identifier);
		
		disconnect();
		
	}