View | Details | Raw Unified | Return to bug 423
Collapse All | Expand All

(-)a/src/applications/packet-sink/packet-sink.cc (+4 lines)
 Lines 119-124    Link Here 
119
  Address from;
119
  Address from;
120
  while (packet = socket->RecvFrom (from))
120
  while (packet = socket->RecvFrom (from))
121
    {
121
    {
122
      if (packet->GetSize() == 0)
123
        { //EOF
124
	  break;
125
        }
122
      if (InetSocketAddress::IsMatchingType (from))
126
      if (InetSocketAddress::IsMatchingType (from))
123
        {
127
        {
124
          InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
128
          InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
(-)a/src/internet-stack/tcp-socket-impl.cc (-3 / +19 lines)
 Lines 145-153    Link Here 
145
    {
145
    {
146
      m_rtt = sock.m_rtt->Copy();
146
      m_rtt = sock.m_rtt->Copy();
147
    }
147
    }
148
  //null out the socket base class recvcallback,
148
  //null out the socket base class callbacks,
149
  //make user of the socket register this explicitly
149
  //make user of the socket register this explicitly
150
  SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > () );
150
  Callback<void, Ptr< Socket > > vPS =
151
      MakeNullCallback<void, Ptr<Socket> > ();
152
  Callback<void, Ptr<Socket>, const Address &> vPSA =
153
      MakeNullCallback<void, Ptr<Socket>, const Address &> ();
154
  Callback<void, Ptr<Socket>, uint32_t> vPSUI =
155
      MakeNullCallback<void, Ptr<Socket>, uint32_t> ();
156
157
  SetConnectCallback (vPS, vPS);
158
  SetDataSentCallback (vPSUI);
159
  SetSendCallback (vPSUI);
160
  SetRecvCallback (vPS);
151
  //can't "copy" the endpoint just yes, must do this when we know the peer info
161
  //can't "copy" the endpoint just yes, must do this when we know the peer info
152
  //too; this is in SYN_ACK_TX
162
  //too; this is in SYN_ACK_TX
153
}
163
}
 Lines 473-478    Link Here 
473
  NS_LOG_FUNCTION_NOARGS ();
483
  NS_LOG_FUNCTION_NOARGS ();
474
  if(m_bufferedData.empty())
484
  if(m_bufferedData.empty())
475
    {
485
    {
486
      if(m_state == CLOSE_WAIT) //means EOF
487
        {
488
          return Create<Packet>();
489
        }
490
      //else, means nothing to read
476
      return 0;
491
      return 0;
477
    }
492
    }
478
  UnAckData_t out; //serves as buffer to return up to the user
493
  UnAckData_t out; //serves as buffer to return up to the user
 Lines 547-553    Link Here 
547
{
562
{
548
  NS_LOG_FUNCTION (this << maxSize << flags);
563
  NS_LOG_FUNCTION (this << maxSize << flags);
549
  Ptr<Packet> packet = Recv (maxSize, flags);
564
  Ptr<Packet> packet = Recv (maxSize, flags);
550
  if (packet != 0)
565
  //Null packet means no data to read, and an empty packet indicates EOF
566
  if (packet != 0 && packet->GetSize() != 0)
551
    {
567
    {
552
      SocketAddressTag tag;
568
      SocketAddressTag tag;
553
      bool found;
569
      bool found;

Return to bug 423