Author: zothar
Date: 2006-11-21 04:30:22 +0000 (Tue, 21 Nov 2006)
New Revision: 11028

Modified:
   trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
Log:
Bug 900: Get rid of unnecessary pings in BlockTransmitter.  I'm leaving 
DMT.ping and DMT.pong for now, since they're used by code in src/test/.

Modified: trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java     2006-11-20 
23:51:22 UTC (rev 11027)
+++ trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java     2006-11-21 
04:30:22 UTC (rev 11028)
@@ -79,7 +79,6 @@
                _senderThread = new Thread("_senderThread for "+_uid+ " to 
"+_destination.getPeer()) {

                        public void run() {
-                               int sentSinceLastPing = 0;
                                while (!_sendComplete) {
                                                long startCycleTime = 
System.currentTimeMillis();
                                                try {
@@ -121,13 +120,6 @@
                                                try {
                                                        
((PeerNode)_destination).sendAsync(DMT.createPacketTransmit(_uid, packetNo, 
_sentPackets, _prb.getPacket(packetNo)), null, PACKET_SIZE, _ctr);
                                                        
_ctr.sentPayload(PACKET_SIZE);
-                                                       // We accelerate the 
ping rate during the transfer to keep a closer eye on round-trip-time
-                                                       sentSinceLastPing++;
-                                                       if (sentSinceLastPing 
>= PING_EVERY) {
-                                                               
sentSinceLastPing = 0;
-                                                               
//_usm.send(BlockTransmitter.this._destination, DMT.createPing());
-                                                               
((PeerNode)_destination).sendAsync(DMT.createPing(), null, 0, _ctr);
-                                                       }
                                                } catch (NotConnectedException 
e) {
                                                        Logger.normal(this, 
"Terminating send: "+e);
                                                        
synchronized(_senderThread) {


Reply via email to