View | Details | Raw Unified | Return to bug 365
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 (-1 / +7 lines)
 Lines 473-478    Link Here 
473
  NS_LOG_FUNCTION_NOARGS ();
473
  NS_LOG_FUNCTION_NOARGS ();
474
  if(m_bufferedData.empty())
474
  if(m_bufferedData.empty())
475
    {
475
    {
476
      if(m_state == CLOSE_WAIT) //means EOF
477
        {
478
          return Create<Packet>();
479
        }
480
      //else, means nothing to read
476
      return 0;
481
      return 0;
477
    }
482
    }
478
  UnAckData_t out; //serves as buffer to return up to the user
483
  UnAckData_t out; //serves as buffer to return up to the user
 Lines 547-553    Link Here 
547
{
552
{
548
  NS_LOG_FUNCTION (this << maxSize << flags);
553
  NS_LOG_FUNCTION (this << maxSize << flags);
549
  Ptr<Packet> packet = Recv (maxSize, flags);
554
  Ptr<Packet> packet = Recv (maxSize, flags);
550
  if (packet != 0)
555
  //Null packet means no data to read, and an empty packet indicates EOF
556
  if (packet != 0 && packet->GetSize() != 0)
551
    {
557
    {
552
      SocketAddressTag tag;
558
      SocketAddressTag tag;
553
      bool found;
559
      bool found;

Return to bug 365