private String getAck() {
		StringBuffer ack = new StringBuffer();
		try {
			int avail = in.available();

			// Wait for the acknowledge.
			while (avail == 0) {
				Thread.sleep(100);
				avail = in.available();
			}
			
			// Receive the acknowledge.
			while (avail > 0) {
				byte[] buff = new byte[avail];
				in.read(buff);
				for (int i = 0; i < buff.length; i++) {
					ack.append((char) buff[i]);
				}
				avail = in.available();
			}
		} catch (IOException E) {
			log.error("# Error: " + E.toString());
			System.exit(-1);
		} catch (InterruptedException E) {
			log.error("# Error: " + E.toString());
			System.exit(-1);
		} catch (Exception E) {
			log.error("# Error: " + E.toString());
			System.exit(-1);
		}
		return ack.toString();
	}