overloaded Recv() method suggested by Gustavo
This commit is contained in:
@@ -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 ();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user