@Override
	public void startTransfer() throws TransferException {
		Runnable r = new Runnable() {
			public void run() {
				try {
					ByteWriter writer = new ByteArrayWriter();
					// 最开始执行了一个i请求
					writer.write("SIPP".getBytes());
					if (!tryExecuteRequest("i", requestId++, writer, 1))
						raiseException(new TransferException(
								"Init Http Transfer failed.."));

					while (!closeFlag) {
						writer.clear();
						BytesEntry entry = bytesEntryQueue.poll(5,
								TimeUnit.SECONDS); // 等待五秒,如果没有元素也返回
						if (entry != null) {
							writer.writeBytes(entry.getBytes(),
									entry.getOffset(), entry.getLength()); //
							while (bytesEntryQueue.size() > 0) {
								entry = bytesEntryQueue.poll();
								writer.writeBytes(entry.getBytes(),
										entry.getOffset(), entry.getLength());
							}
						}
						writer.write("SIPP".getBytes());

						// 尝试发送这个请求，如果超过指定次数，传递传输异常
						if (!tryExecuteRequest("s", requestId++, writer, 3)) {
							closeFlag = true;
							raiseException(new TransferException());
						}
					}

					// 结束
					writer.clear();
					writer.write("SIPP".getBytes());
					tryExecuteRequest("d", requestId++, writer, 1);

				} catch (Throwable e) {
					raiseException(new TransferException(e));
				}
			}
		};

		this.runThead = new Thread(r);
		this.runThead.setName(this.getTransferName());
		this.runThead.start();
	}