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

	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)
	{
		return this.hashCode() == ((GossipPartner)other).hashCode();
	}//equals

	public InetSocketAddress getGossipPartnerAddress()
	{
		return this.gossipPartnerAddress;
	}//getGossipPartnerAddress

	public int hashCode()
	{
		return this.gossipPartnerAddress.toString().hashCode();
	}//hashcode

	public boolean isAlive()
	{
		return this.isAlive;
	}//isAlive

	public void send(UDPMessage message)
	{;
		DatagramSocket			socket;
		DatagramPacket			dp;
		try
		{
			socket = new DatagramSocket(this.getGossipPartnerAddress());
			dp = message.getDatagramPacket();
			dp.setAddress(socket.getInetAddress());
			this.queue.enQueue(message.getDatagramPacket());

		}
		catch(SocketException se)
		{
			System.out.println(se.getMessage());
		}
	}//send

}//gossipPartner

@@ -105,14 +105,951 @@
 2015
+%0A%0A%09Class Variables:%0A%09%09gossipPartnerAddress%0A%09%09%09an InetSocketAddress that contains the partners address%0A%09%09isAlive%0A%09%09%09A boolean that is true for alive, false for not%0A%09%09queue%0A%09%09%09An OutgoingPacketQueue that contains the queue%0A%09Constructors:%0A%09%09GossipPartner(InetSocketAddress gossipPartnerAddress, OutgoingPacketQueue queue)%0A%09%09%09Initalizes both of the instance variables%0A%09Methods:%0A%09%09public boolean equals(Object other)%0A%09%09%09Checks to see if this hashcode is equal to the paramters hashcode%0A%09%09public InetSocketAddress getGossipPartnerAddress()%0A%09%09%09Returns the instance variable getGossipPartnerAddress%0A%09%09public int hashCode()%0A%09%09%09Returns a hashcode value of the object%0A%09%09public boolean isAlive()%0A%09%09%09Returns the instance variable isAlive%0A%09%09public void send(UDPMessage message)%0A%09%09%09Creates the datagramSocket and datagramPacket sets the IP address of the machine to%0A%09%09%09which this datagram is being sent. Then the messages datagramPacket is put in queue.
 %0A%09*/%0A
-%0A
 %09pri
@@ -1063,32 +1063,33 @@
 etSocketAddress 
+%09
 gossipPartnerAdd
@@ -1107,24 +1107,27 @@
 ate boolean 
+%09%09%09
 isAlive;%0A%09pr
@@ -1280,16 +1280,17 @@
 Address 
+%09
 = gossip
@@ -1318,16 +1318,21 @@
 s.queue 
+%09%09%09%09%09
 = queue;
@@ -1385,24 +1385,94 @@
 t other)%0A%09%7B%0A
+%09%09//Checks to see if this hashcode is equal to the paramters hashcode%0A
 %09%09return thi
@@ -1585,24 +1585,82 @@
 ddress()%0A%09%7B%0A
+%09%09//Returns the instance variable getGossipPartnerAddress%0A
 %09%09return thi
@@ -1734,24 +1734,67 @@
 shCode()%0A%09%7B%0A
+%09%09//Returns a hashcode value of the object%0A
 %09%09return thi
@@ -1882,16 +1882,58 @@
 ve()%0A%09%7B%0A
+%09%09//Returns the instance variable isAlive%0A
 %09%09return
@@ -2000,17 +2000,193 @@
 sage)%0A%09%7B
-;
+%0A%09%09//Creates the datagramSocket and datagramPacket sets the IP address of the machine to%0A%09%09//which this datagram is being sent. Then the messages datagramPacket is put in queue.
 %0A%09%09Datag
@@ -2434,17 +2434,16 @@
 ket());%0A
-%0A
 %09%09%7D%0A%09%09ca

Update GossipPartner.java