improve send semantics, documentation

This commit is contained in:
Tom Henderson
2008-05-15 23:06:58 -07:00
parent aa7b91f890
commit 18011ba4eb
4 changed files with 63 additions and 10 deletions

View File

@@ -240,11 +240,12 @@ PacketSocket::Send (Ptr<Packet> p)
return SendTo (p, m_destAddr);
}
// XXX must limit it to interface MTU
uint32_t
PacketSocket::GetTxAvailable (void) const
{
// No finite send buffer is modelled
return 0xffffffff;
// Use 65536 for now
return 0xffff;
}
int
@@ -277,6 +278,11 @@ PacketSocket::SendTo(Ptr<Packet> p, const Address &address)
m_errno = ERROR_AFNOSUPPORT;
return -1;
}
if (p->GetSize () > GetTxAvailable ())
{
m_errno = ERROR_MSGSIZE;
return -1;
}
ad = PacketSocketAddress::ConvertFrom (address);
bool error = false;