Code example for DatagramPacket

Methods: getDatagetLengthsetData

0
		return false; 
	} 
 
	public void handlePacket(DatagramPacket packet) {
		//set the correct packet byte size 
		byte[] src = packet.getData();
		byte[] dst = new byte[packet.getLength()];
		System.arraycopy(src, 0, dst, 0, dst.length);
		packet.setData(dst);
		//add it to the queue 
		theReceiveQueue.add(packet);
		//notify the context 
		context.dispatchStatusEventAsync("receive", "");
	} 
	 
	public void log(Exception e) {
		context.dispatchStatusEventAsync("error", e.getMessage());
	} 
	 
	public void log(String message) {
		context.dispatchStatusEventAsync("log", message);