@Override
	public void run() {
		char read;
		try {
			while ((read = (char) inputStream.read()) != -1) {
				if (read == '\n' || read == '\r') {
					command = inputBuffer.toString();
					printOutputStream.print("\r\nServer: " + command + "\r\n");
					inputBuffer = new StringBuffer();
				} else if (read == '\u007f') {
					printOutputStream.print("\b \b");
					if (inputBuffer.length() >= 1) {
						inputBuffer.deleteCharAt(inputBuffer.length() - 1);
					}
				} else if (read == '\u0003') {
					return;
				} else {
					inputBuffer.append(read);
					printOutputStream.print(read);
				}
				printOutputStream.flush();
				if ("quit".equals(command) || "exit".equals(command)) {
					return;
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			exitCallback.onExit(0);
		}

	}