overloaded Recv() method suggested by Gustavo

This commit is contained in:
Tom Henderson
2008-05-02 09:38:18 -07:00
parent f8a2add627
commit bfe0533aa3
8 changed files with 22 additions and 18 deletions

View File

@@ -107,6 +107,12 @@ int Socket::Send (const uint8_t* buf, uint32_t size)
return Send (p);
}
Ptr<Packet>
Socket::Recv (void)
{
return Recv (std::numeric_limits<uint32_t>::max(), 0);
}
int Socket::SendTo (const Address &address, const uint8_t* buf, uint32_t size)
{
NS_LOG_FUNCTION_NOARGS ();

View File

@@ -263,6 +263,16 @@ public:
* to the maxSize and flags.
*/
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags) = 0;
/**
* \brief Read a single packet from the socket
*
* Overloaded version of Recv(maxSize, flags) with maxSize
* implicitly set to maximum sized integer, and flags set to zero.
*
* \returns Ptr<Packet> of the next in-sequence packet. Returns
* 0 if the socket cannot return a next in-sequence packet.
*/
Ptr<Packet> Recv (void);
protected:
void NotifyCloseCompleted (void);