src/internet-node/tcp-socket-impl.cc
changeset 3246 d734f62d4921
parent 3245 ad57fb768f3a
child 3248 39f736210ab2
equal deleted inserted replaced
3245:ad57fb768f3a 3246:d734f62d4921
   924           break; // No more
   924           break; // No more
   925         }
   925         }
   926       uint32_t s = std::min (w, m_segmentSize);  // Send no more than window
   926       uint32_t s = std::min (w, m_segmentSize);  // Send no more than window
   927       Ptr<Packet> p = m_pendingData->CopyFromSeq (s, m_firstPendingSequence, 
   927       Ptr<Packet> p = m_pendingData->CopyFromSeq (s, m_firstPendingSequence, 
   928         m_nextTxSequence);
   928         m_nextTxSequence);
   929       NS_LOG_LOGIC("TcpSocketImpl " << this << " sendPendingData"
   929       NS_LOG_LOGIC("TcpSocketImpl " << this << " SendPendingData"
   930                    << " txseq " << m_nextTxSequence
   930                    << " txseq " << m_nextTxSequence
   931                    << " s " << s 
   931                    << " s " << s 
   932                    << " datasize " << p->GetSize() );
   932                    << " datasize " << p->GetSize() );
   933       uint8_t flags = 0;
   933       uint8_t flags = 0;
   934       if (withAck)
   934       if (withAck)
   959 
   959 
   960       
   960       
   961       if (m_retxEvent.IsExpired () ) //go ahead and schedule the retransmit
   961       if (m_retxEvent.IsExpired () ) //go ahead and schedule the retransmit
   962         {
   962         {
   963             Time rto = m_rtt->RetransmitTimeout (); 
   963             Time rto = m_rtt->RetransmitTimeout (); 
   964             NS_LOG_LOGIC ("Schedule retransmission timeout at time " << 
   964             NS_LOG_LOGIC ("SendPendingData Schedule retransmission timeout at time " << 
   965               Simulator::Now ().GetSeconds () << " to expire at time " <<
   965               Simulator::Now ().GetSeconds () << " to expire at time " <<
   966               (Simulator::Now () + rto).GetSeconds () );
   966               (Simulator::Now () + rto).GetSeconds () );
   967           m_retxEvent = Simulator::Schedule (rto,&TcpSocketImpl::ReTxTimeout,this);
   967           m_retxEvent = Simulator::Schedule (rto,&TcpSocketImpl::ReTxTimeout,this);
   968         }
   968         }
   969       NS_LOG_LOGIC ("About to send a packet with flags: " << flags);
   969       NS_LOG_LOGIC ("About to send a packet with flags: " << flags);
   976       nPacketsSent++;                             // Count sent this loop
   976       nPacketsSent++;                             // Count sent this loop
   977       m_nextTxSequence += sz;                     // Advance next tx sequence
   977       m_nextTxSequence += sz;                     // Advance next tx sequence
   978       // Note the high water mark
   978       // Note the high water mark
   979       m_highTxMark = std::max (m_nextTxSequence, m_highTxMark);
   979       m_highTxMark = std::max (m_nextTxSequence, m_highTxMark);
   980     }
   980     }
   981   NS_LOG_LOGIC ("Sent "<<nPacketsSent<<" packets");
   981     NS_LOG_LOGIC ("SendPendingData Sent "<<nPacketsSent<<" packets");
   982   NS_LOG_LOGIC("RETURN SendPendingData");
   982   NS_LOG_LOGIC("RETURN SendPendingData");
   983   return (nPacketsSent>0);
   983   return (nPacketsSent>0);
   984 }
   984 }
   985 
   985 
   986 uint32_t  TcpSocketImpl::UnAckDataCount ()
   986 uint32_t  TcpSocketImpl::UnAckDataCount ()