|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--info.jedi.net.DefaultPacketHandler | +--info.jedi.net.ReliableHandler
This class adds reliability to JEDI packets. It provides methods for handling incoming reliability packets and for adding reliability to outgoing packets. It includes a background thread for resending packets that are never acknowledged. Every packet that is sent out will be acknowledged when it is received. The sender will resend a packet until it is acknowledged, so if a receiver gets multiple sent packets it should assume that its first acknowledgement was lost and send another.
MailDaemon
,
RMCHandler
,
CommunicationPort
,
LocationID
Field Summary | |
static int |
DEFAULT_TIMEOUT
The default timeout in milliseconds is 60000 (60 seconds) |
static byte |
RELIABLE_HANDLER_NUMBER
The index of the ReliableHandler in the MailDaemon dispatch table |
static int |
RESEND_INTERVAL
How many milliseconds between resending packets |
Method Summary | |
protected void |
acknowledge(InputPacket packet)
Sends an acknowledgement packet for the receipt of this InputPacket |
protected CommunicationPort |
getPort(Packet packet)
Gets the CommunicationPort associated with the address and port of the Packet, creating one if necessary |
boolean |
handlePacket(InputPacket packet)
handles an incoming reliable packet. |
void |
initializePacket(OutputPacket packet)
Adds reliability to an outgoing packet. |
void |
run()
This is the background thread that resends messages that have not yet been acknowledged |
boolean |
sendPacket(OutputPacket packet)
Does the work necessary just before a reliable OutputPacket is sent. |
Methods inherited from class info.jedi.net.DefaultPacketHandler |
handleError |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final byte RELIABLE_HANDLER_NUMBER
public static final int RESEND_INTERVAL
public static final int DEFAULT_TIMEOUT
Method Detail |
public void initializePacket(OutputPacket packet) throws java.io.IOException
public boolean sendPacket(OutputPacket packet) throws java.io.IOException
public boolean handlePacket(InputPacket packet) throws java.io.IOException
protected CommunicationPort getPort(Packet packet)
protected void acknowledge(InputPacket packet) throws java.io.IOException
public void run()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |