Skip to contentSkip to conversation

want to randomly drop packets based on percent

DISCUSSION Bodo Eggert 1 participant 1 message Apr 17, 2006 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · George Nychis

But then I ran into the problem of properly seeding the random number generator... srand(time(0)) is one way... however time() returns seconds, therefore i would drop multiple packets in a single second if I used this method which is very undesirable. What is the proper way to generate a random number here?

You seed the random generator once, not each time you use it.

Signature · 2 lines
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.