import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;

public class DatagramSender extends DatagramSenderReceiver {
	/**
	 * 
	 * @param inetSocketAddress
	 * @param queue
	 * @param packetSize
	 * @throws SocketException 
	 */
	public DatagramSender(InetSocketAddress inetSocketAddress, OutgoingPacketQueue queue, int packetSize) throws SocketException 
	{
		// TODO
		super(inetSocketAddress, queue, packetSize);
	}

	@Override
	public void action(DatagramSocket datagramSocket, SynchronizedLinkedListQueue queue) 
	{
		// TODO 

	}

}

@@ -97,79 +97,457 @@
 on;%0A
-%0Apublic class DatagramSender extends DatagramSenderReceiver %7B%0A%09/**%0A%09 * 
+import java.util.concurrent.atomic.AtomicBoolean;%0A%0A%0Apublic abstract class DatagramSenderReceiver implements Runnable%0A%7B%0A%09%0A%09private AtomicBoolean %09%09%09%09done;%0A%09private DatagramSocket %09%09%09%09datagramSocket;%0A%09private int%09%09%09%09%09%09%09packetSize;%0A%09private SynchronizedLinkedListQueue queue;%0A%09%0A%09/**%0A%09 * Binds the datagramSocket to the inetSocketAddress, and instantiates the queue and packet size%0A%09 * instance variables. Also sets the atomic boolean variable to false.
 %0A%09 *
@@ -638,17 +638,16 @@
 xception
- 
 %0A%09 */%0A%09p
@@ -666,16 +666,24 @@
 amSender
+Receiver
 (InetSoc
@@ -716,21 +716,29 @@
 ss, 
-OutgoingPacke
+SynchronizedLinkedLis
 tQue
@@ -793,88 +793,1356 @@
  %0A%09%7B
+%09
 %0A%09%09
-// TODO%0A%09%09super(inetSocketAddress, queue, packetSize);%0A%09%7D%0A%0A%09@Override%0A%09public
+this.done.set(false);%0A%09%09this.packetSize = packetSize;%0A%09%09this.queue = queue;%0A%09%09datagramSocket = new DatagramSocket(inetSocketAddress);%0A%09%7D%0A%09%0A%09/**%0A%09 * Basic getter.%0A%09 * @return%0A%09 * %09%09packet size%0A%09 */%0A%09public int getPacketSize()%0A%09%7B%0A%09%09return this.packetSize;%0A%09%7D%0A%09%0A%09/**%0A%09 * While the atomic boolean is not set to done, the method runs and performs the given action, sleeping%0A%09 * 100 miliseconds after every action.%0A%09 */%0A%09public void run()%0A%09%7B%0A%09%09while(!this.isStopped())%0A%09%09%7B%0A%09%09%09this.action(this.datagramSocket, this.queue);%0A%09%09%09try %7B%0A%09%09%09%09Thread.sleep(100);%0A%09%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09%09// TODO Auto-generated catch block%0A%09%09%09%09System.err.println(%22Thread sleep method was interrupted.%22);%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09/**%0A%09 * Sets the atomic boolean to true, and closes the datagram socket.%0A%09 */%0A%09public void stop()%0A%09%7B%0A%09%09this.done.set(true);%0A%09%09this.datagramSocket.close();%0A%09%7D%0A%09%0A%09/**%0A%09 * Determines if the run method has been stopped.%0A%09 * @return%0A%09 * %09%09The get method on the atomic boolean.%0A%09 */%0A%09public boolean isStopped()%0A%09%7B%0A%09%09return this.done.get();%0A%09%7D%0A%09%0A%09/**%0A%09 * Starts a new thread and returns a reference to the thread.%0A%09 * @return%0A%09 * %09%09A reference to the newly started thread. %0A%09 */%0A%09public Thread startAsThread() %0A%09%7B%0A%09%09Thread thread;%0A%09%09%0A%09%09thread = new Thread(this);%0A%09%09thread.start();%0A%09%09%0A%09%09return thread;%0A%09%7D%0A%09%0A%09public abstract
  voi
@@ -2219,27 +2219,10 @@
 eue)
- %0A%09%7B%0A%09%09// TODO %0A%0A%09%7D%0A
+;%0A%09
 %0A%7D%0A

Update DatagramSender.java