|
|
| 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 |
} |
|
|
| 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 |
|
|
| 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; |