import java.net.*;
public class GossipPartner
{
	/*
	Courtney Karppi
	CISC 370 - GossipProtocol
	May 5, 2015

	Class Variables:
		gossipPartnerAddress
			an InetSocketAddress that contains the partners address
		isAlive
			A boolean that is true for alive, false for not
		queue
			An OutgoingPacketQueue that contains the queue
	Constructors:
		GossipPartner(InetSocketAddress gossipPartnerAddress, OutgoingPacketQueue queue)
			Initalizes both of the instance variables
	Methods:
		public boolean equals(Object other)
			Checks to see if this hashcode is equal to the paramters hashcode
		public InetSocketAddress getGossipPartnerAddress()
			Returns the instance variable getGossipPartnerAddress
		public int hashCode()
			Returns a hashcode value of the object
		public boolean isAlive()
			Returns the instance variable isAlive
		public void send(UDPMessage message)
			Creates the datagramSocket and datagramPacket sets the IP address of the machine to
			which this datagram is being sent. Then the messages datagramPacket is put in queue.
	*/
	private InetSocketAddress 	gossipPartnerAddress;
	private boolean 			isAlive;
	private OutgoingPacketQueue queue;

	public GossipPartner(InetSocketAddress gossipPartnerAddress, OutgoingPacketQueue queue)
	{
		this.gossipPartnerAddress 	= gossipPartnerAddress;
		this.queue 					= queue;
	}//constructor

	public boolean equals(Object other)
	{
		//Checks to see if this hashcode is equal to the paramters hashcode
		return this.hashCode() == ((GossipPartner)other).hashCode();
	}//equals

	public InetSocketAddress getGossipPartnerAddress()
	{
		//Returns the instance variable getGossipPartnerAddress
		return this.gossipPartnerAddress;
	}//getGossipPartnerAddress

	public int hashCode()
	{
		//Returns a hashcode value of the object
		return this.gossipPartnerAddress.toString().hashCode();
	}//hashcode

	public boolean isAlive()
	{
		//Returns the instance variable isAlive
		return this.isAlive;
	}//isAlive


	public void send(UDPMessage message)
	{
		//Creates the datagramSocket and datagramPacket sets the IP address of the machine to
		//which this datagram is being sent. Then the messages datagramPacket is put in queue.
		//DatagramSocket			socket;
		DatagramPacket			dp;
		try
		{
		//	socket = new DatagramSocket(this.getGossipPartnerAddress());
			dp = message.getDatagramPacket();
			dp.setAddress(getGossipPartnerAddress().getAddress());
			this.queue.enQueue(message.getDatagramPacket());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}//send

}//gossipPartner

@@ -2247,11 +2247,11 @@
 %7B%0A%09%09
+%09
 //
-%09
 sock
@@ -2259,26 +2259,8 @@
 t = 
-new DatagramSocket
 (thi
@@ -2343,16 +2343,21 @@
 Address(
+this.
 getGossi
@@ -2389,16 +2389,56 @@
 ess());%0A
+%09%09%09System.out.println(dp.getAddress());%0A
 %09%09%09this.
@@ -2553,20 +2553,21 @@
 d%0A%0A%7D//gossipPartner%0A
+%0A

Update GossipPartner.java