|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--info.jedi.net.CommunicationPort
This class handles reliable communication to and from a remote location. Here location refers to a specific internet address and port. It keeps track of all the messages currently being sent and those that have recently been received, to make sure that messages are resent if they are not acknowledged and to make sure that no message is neglected or received more than once.
ReliableHandler
Field Summary | |
static int |
MAX_SENT
The maximum number of messages in the sending window at once (for all CommunicationPorts in this VM). |
Constructor Summary | |
CommunicationPort(java.net.InetAddress address,
int port,
ReliableHandler reliableHandler)
Creates a Communication port associated with this address and port |
Method Summary | |
boolean |
add(OutputPacket packet)
Adds an OutputPacket to the sending queue. |
java.net.InetAddress |
address()
the address this communication port is associated with |
boolean |
hasReceived(InputPacket packet)
Checks to see if a given InputPacket has been received before. |
int |
port()
the port this communication port is associated with |
void |
remove(int id)
Removes an OutputPacket from the sending queue. |
protected void |
resend(OutputPacket packet)
Resends a particular packet |
void |
resendAll()
resends all messages to the address & port associated with this object that have not yet been acknowledged. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int MAX_SENT
Constructor Detail |
public CommunicationPort(java.net.InetAddress address, int port, ReliableHandler reliableHandler)
Method Detail |
public java.net.InetAddress address()
public int port()
public void resendAll() throws java.io.IOException
public boolean hasReceived(InputPacket packet)
public boolean add(OutputPacket packet)
remove(int)
public void remove(int id)
id
- the id of the packet to remove.protected void resend(OutputPacket packet) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |