network: Packet socket client does not schedule Send() for bursts of packets
This commit is contained in:
@@ -183,7 +183,17 @@ PacketSocketClient::Send()
|
||||
|
||||
if ((m_sent < m_maxPackets) || (m_maxPackets == 0))
|
||||
{
|
||||
m_sendEvent = Simulator::Schedule(m_interval, &PacketSocketClient::Send, this);
|
||||
if (m_interval.IsZero())
|
||||
{
|
||||
NS_ABORT_MSG_IF(
|
||||
m_maxPackets == 0,
|
||||
"Generating infinite packets at the same time does not seem to be a good idea");
|
||||
Send();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sendEvent = Simulator::Schedule(m_interval, &PacketSocketClient::Send, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@ class PacketSocketClient : public Application
|
||||
|
||||
/**
|
||||
* \brief Send a packet
|
||||
*
|
||||
* Either <i>Interval</i> and <i>MaxPackets</i> may be zero, but not both. If <i>Interval</i>
|
||||
* is zero, the PacketSocketClient will send <i>MaxPackets</i> packets without any delay into
|
||||
* the socket. If <i>MaxPackets</i> is zero, then the PacketSocketClient will send every
|
||||
* <i>Interval</i> until the application is stopped.
|
||||
*/
|
||||
void Send();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user