Add uint8_t* based API for sockets

This commit is contained in:
Raj Bhattacharjea committed 2007-12-13 09:40:21 -05:00
1 parent 8e1dd91b8c
commit b9d8c0ebff
2 files changed
+55

No files matched your search

+30
View File
@@ -78,6 +78,36 @@ Socket::SetRecvCallback (Callback<void, Ptr<Socket>, Ptr<Packet>,const Address&>
m_receivedData = receivedData;
}
int Socket::Send (const uint8_t* buf, uint32_t size)
{
NS_LOG_FUNCTION;
Ptr<Packet> p;
if (buf)
{
p = Create<Packet> (buf, size);
}
else
{
p = Create<Packet> (size);
}
return Send (p);
}
int Socket::SendTo (const Address &address, const uint8_t* buf, uint32_t size)
{
NS_LOG_FUNCTION;
Ptr<Packet> p;
if(buf)
{
p = Create<Packet> (buf, size);
}
else
{
p = Create<Packet> (size);
}
return SendTo (address,p);
}
void
Socket::NotifyCloseCompleted (void)
{