public byte[] receive() {
		try {
			byte[] receiveBuffer = new byte[300000000];
			System.out.println("Start Receiving Data......");
			while(true) {
				TTP rec = receiveDatagram();
				if (rec == null) {
					continue;
				}
				int offset = rec.getOffset();
				
				for(int i = 0; i < rec.getLength(); i++) {
					receiveBuffer[i + offset] = ((byte[])(rec.getData()))[i]; 
				}
				
				if (rec.getFlag() == (char)1) {
					int len = offset + rec.getLength();
					byte[] receive = new byte[len];
					for (int i = 0; i < len; i++) {
						receive[i] = receiveBuffer[i];
					}
					return receive;
				}
			}
		} catch(ArrayIndexOutOfBoundsException e) {
			System.out.println("Error: receive buffer overflow");
			return null;
		}
	}