Plumb in socket receive pull model, in parallel to existing Receive framework
This commit is contained in:
1 parent
776f7dc5ac
commit
1c73dd0dd8
10 files changed
+89
-2
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user