public class RandomLossGenerator extends Object implements LossGenerator
| Constructor and Description |
|---|
RandomLossGenerator(double lossRate)
Construct loss generator with given loss rate as percentage.
|
RandomLossGenerator(double lossRate,
long lossSeed)
Construct loss generator with given loss rate as percentage and random seed
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldDropFrame(InetSocketAddress address,
UnsafeBuffer buffer,
int length)
Should a frame be dropped?
|
public RandomLossGenerator(double lossRate)
lossRate - for generating losspublic RandomLossGenerator(double lossRate,
long lossSeed)
lossRate - for generating losslossSeed - for random seedingpublic boolean shouldDropFrame(InetSocketAddress address, UnsafeBuffer buffer, int length)
LossGeneratorshouldDropFrame in interface LossGeneratoraddress - The source address of the frame if inbound or the remote address if outbound.buffer - The buffer containing the frame data.length - The length of the frame.Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.