private void sendDatagram(Object[] d, short[] dLength) {
		constructDataSegment(d, dLength);
		sendTimer = new GoBackNTimer(10, window);
		sendTimer.start();
		while (window[0] < window[2]) {
			
			for (int i = window[1]; i < window[2]; i++) {
				System.out.println("Sending data " + (float)(i + 1) / d.length * 100 + "%");
				
				if (i == d.length - 1) {
					sendData[i].timer = sendData(ACK, sendData[i].SYN, clientaddr, 
							clientport, sendData[i].data, sendData[i].dataLength, 
							(char)3, 1, true, sendData[i].offset, 0);
				} else {
					sendData[i].timer = sendData(ACK, sendData[i].SYN, clientaddr, 
							clientport, sendData[i].data, sendData[i].dataLength, 
							(char)3, 1, false, sendData[i].offset, 0);
				}
				window[1] += 1;
				
				sendTimer.interrupt();
				sendTimer = new GoBackNTimer(10, window);
				sendTimer.start();
			}
			
			if (receiveFlag) {
				moveWindow();
				receiveFlag = false;
			}
		}
		sendTimer.interrupt();
		window[0] = 0;
		window[1] = 0;
		window[2] = 0;
	}