[dijjer-cvs] Dijjer/src/dijjer/io/xfer BlockReceiver.java,1.15,1.16
Brought to you by:
gnovos
|
From: Chris <ch...@us...> - 2005-08-25 23:40:32
|
Update of /cvsroot/dijjer/Dijjer/src/dijjer/io/xfer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11833/src/dijjer/io/xfer Modified Files: BlockReceiver.java Log Message: Changed receive() so that filters are created earlier. Trying to track down why there are so many unmatched packetTransmit messages. Index: BlockReceiver.java =================================================================== RCS file: /cvsroot/dijjer/Dijjer/src/dijjer/io/xfer/BlockReceiver.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** BlockReceiver.java 25 Aug 2005 00:24:18 -0000 1.15 --- BlockReceiver.java 25 Aug 2005 23:40:24 -0000 1.16 *************** *** 62,70 **** public byte[] receive() throws RetrievalException { int consecutiveMissingPacketReports = 0; while (!_prb.allReceived()) { ! Message m1 = _usm.waitFor((MessageFilter.create( ! _prb.numReceived() == 0 ? INITIAL_RECEIPT_TIMEOUT : RECEIPT_TIMEOUT, DMT.packetTransmit) ! .addType(DMT.allSent).addType(DMT.sendAborted)) ! .setField(DMT.UID, _uid)); if ((m1 != null) && (m1.getSpec().equals(DMT.packetTransmit))) { consecutiveMissingPacketReports = 0; --- 62,77 ---- public byte[] receive() throws RetrievalException { int consecutiveMissingPacketReports = 0; + MessageFilter f = MessageFilter.create(INITIAL_RECEIPT_TIMEOUT, DMT.packetTransmit) + .setField(DMT.UID, _uid) + .addType(DMT.allSent) + .addType(DMT.sendAborted); while (!_prb.allReceived()) { ! Message m1 = _usm.waitFor(f); ! // Get ready for the next packet ! f = MessageFilter.create(RECEIPT_TIMEOUT, DMT.packetTransmit) ! .setField(DMT.UID, _uid) ! .addType(DMT.allSent) ! .addType(DMT.sendAborted); ! // The faster we finish the rest of this loop the better! if ((m1 != null) && (m1.getSpec().equals(DMT.packetTransmit))) { consecutiveMissingPacketReports = 0; *************** *** 84,90 **** Long resendTime = (Long) _recentlyReportedMissingPackets.get(new Integer(x)); if ((resendTime == null) || (System.currentTimeMillis() > resendTime.longValue())) { ! // Make a note of the earliest time we should resend this, based on the number of other ! // packets we ! // are already waiting for long resendWait = System.currentTimeMillis() + (MAX_ROUND_TRIP_TIME + (_recentlyReportedMissingPackets.size() * MAX_SEND_INTERVAL)); --- 91,96 ---- Long resendTime = (Long) _recentlyReportedMissingPackets.get(new Integer(x)); if ((resendTime == null) || (System.currentTimeMillis() > resendTime.longValue())) { ! // Make a note of the earliest time we should resend this, ! // based on the number of other packets we are already waiting for long resendWait = System.currentTimeMillis() + (MAX_ROUND_TRIP_TIME + (_recentlyReportedMissingPackets.size() * MAX_SEND_INTERVAL)); *************** *** 102,105 **** --- 108,112 ---- } } + continue; } if ((m1 != null) && m1.getSpec().equals(DMT.sendAborted)) { |