Plumb in socket receive pull model, in parallel to existing Receive framework

This commit is contained in:
Tom Henderson committed 2008-04-24 08:18:01 -07:00
1 parent 776f7dc5ac
commit 1c73dd0dd8
10 files changed
+89 -2

No files matched your search

+16
View File
@@ -86,6 +86,13 @@ Socket::SetRecvCallback (Callback<void, Ptr<Socket>, Ptr<Packet>,const Address&>
m_receivedData = receivedData;
}
void
Socket::SetRecv_Callback (Callback<void, Ptr<Socket> > receivedData)
{
NS_LOG_FUNCTION_NOARGS ();
m_receivedData_ = receivedData;
}
int Socket::Listen (uint32_t queueLimit)
{
return 0; //XXX the base class version does nothing
@@ -230,4 +237,13 @@ Socket::NotifyDataReceived (Ptr<Packet> p, const Address &from)
}
}
void
Socket::NotifyDataRecv (void)
{
NS_LOG_FUNCTION_NOARGS ();
if (!m_receivedData_.IsNull ())
{
m_receivedData_ (this);
}
}
}//namespace ns3