public void run() {
			byte[] packet_buffer;
			do {
				packet_buffer = new byte[1024];
				try {
					DatagramPacket packet = new DatagramPacket(packet_buffer,
							packet_buffer.length);
					serverSocket.receive(packet);

					int packet_number = Utilities.getPacketNum(packet_buffer);
					InetAddress src_ip = packet.getAddress();
					int src_port = packet.getPort();

					if (Utilities.isEOF(packet_buffer)) {
						packet_buffer = Utilities.cleanUpEOF(packet_buffer);
					}

					/**
					 * Packet management is carried out within this thread. It
					 * might have been more efficient to implement it in the
					 * main program.
					 */
					if (packet_number < start_window) {
						// Send acknowledgment for previously received packets
						serverSocket.send(Utilities.createAckPacket(
								packet_number, src_ip, src_port));

					} else if (packet_number > end_window) {
						// Discard packets beyond the current window
						continue;

					} else if (packet_number == start_window) {
						// Accept the packet and add it to the write buffer
						synchronized (write_buffer) {
							write_buffer.add(packet_buffer);
						}

						adjustWindowBy(1);
						serverSocket.send(Utilities.createAckPacket(
								packet_number, src_ip, src_port));

						// Add any packets in the window buffer that are next in
						// line to the write buffer
						boolean check = false;
						do {
							byte[] write = popPacket(start_window);
							if (write != null) {
								write_buffer.add(write);
								adjustWindowBy(1);
								check = true;
							} else {
								check = false;
							}
						} while (check);

					} else if (checkForPacket(packet_number) == true) {
						// Filter out duplicate packets
						continue;

					} else {
						// Packet is within the window but not next in line
						// Accept the packet and add it to the window buffer
						addPacket(packet_buffer);
						serverSocket.send(Utilities.createAckPacket(
								packet_number, src_ip, src_port));

					}

				} catch (Exception e) {
				}

			} while (cont);
		}