public void run() {
		while (true) {
			try {
				char temp = ' ';
				int len = 0;
				while ((temp = (char) in.read()) != '\0'){
					if (Character.isDigit(temp)) {
						len = len * 10 + Integer.parseInt(""+temp);
					}
				}
				StringBuilder msg = new StringBuilder();
				for (int i = 0; i < len; i++) {
					char ch = (char) in.read();
					if (ch == '\0') {
						msg.append("\n#\n");
						continue;
					} else if (ch == '\1') {
						msg.append("\n##\n");
						continue;
					} else if (ch == '\2') {
						msg.append("\n###\n");
						continue;
					}
					msg.append(ch);
				}
				client.msgHandler(msg.toString());
			} catch (IOException e) {
				System.out.println("Encountered IOException while listening to server.");
			}
		}
	}