diff --git a/src/network/utils/packet-socket-client.cc b/src/network/utils/packet-socket-client.cc
index 61eb94f5d..96634f78b 100644
--- a/src/network/utils/packet-socket-client.cc
+++ b/src/network/utils/packet-socket-client.cc
@@ -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);
+ }
}
}
diff --git a/src/network/utils/packet-socket-client.h b/src/network/utils/packet-socket-client.h
index f20d479ea..ac10c73e8 100644
--- a/src/network/utils/packet-socket-client.h
+++ b/src/network/utils/packet-socket-client.h
@@ -91,6 +91,11 @@ class PacketSocketClient : public Application
/**
* \brief Send a packet
+ *
+ * Either Interval and MaxPackets may be zero, but not both. If Interval
+ * is zero, the PacketSocketClient will send MaxPackets packets without any delay into
+ * the socket. If MaxPackets is zero, then the PacketSocketClient will send every
+ * Interval until the application is stopped.
*/
void Send();